diff options
-rw-r--r-- | drivers/staging/panel/Kconfig | 24 | ||||
-rw-r--r-- | drivers/staging/panel/panel.c | 193 |
2 files changed, 13 insertions, 204 deletions
diff --git a/drivers/staging/panel/Kconfig b/drivers/staging/panel/Kconfig index 7cf655757748..c4b30f2a549b 100644 --- a/drivers/staging/panel/Kconfig +++ b/drivers/staging/panel/Kconfig | |||
@@ -3,13 +3,12 @@ config PANEL | |||
3 | depends on PARPORT | 3 | depends on PARPORT |
4 | ---help--- | 4 | ---help--- |
5 | Say Y here if you have an HD44780 or KS-0074 LCD connected to your | 5 | Say Y here if you have an HD44780 or KS-0074 LCD connected to your |
6 | parallel port. This driver also features 4 and 6-key keypads, and a | 6 | parallel port. This driver also features 4 and 6-key keypads. The LCD |
7 | 'smartcard' reader. The LCD is accessible through the /dev/lcd char | 7 | is accessible through the /dev/lcd char device (10, 156), and the |
8 | device (10, 156), the keypad through /dev/keypad (10, 185), and the | 8 | keypad through /dev/keypad (10, 185). Both require misc device to be |
9 | smartcard through /dev/smartcard (10, 186). Both require misc device | 9 | enabled. This code can either be compiled as a module, or linked into |
10 | to be enabled. This code can either be compiled as a module, or linked | 10 | the kernel and started at boot. If you don't understand what all this |
11 | into the kernel and started at boot. If you don't understand what all | 11 | is about, say N. |
12 | this is about, say N. | ||
13 | 12 | ||
14 | config PANEL_PARPORT | 13 | config PANEL_PARPORT |
15 | int "Default parallel port number (0=LPT1)" | 14 | int "Default parallel port number (0=LPT1)" |
@@ -45,17 +44,6 @@ config PANEL_PROFILE | |||
45 | wired to the parallel port, and how it works. This is only intended | 44 | wired to the parallel port, and how it works. This is only intended |
46 | for experts. | 45 | for experts. |
47 | 46 | ||
48 | config PANEL_SMARTCARD | ||
49 | depends on PANEL && PANEL_PROFILE="0" | ||
50 | bool "Enable smartcard reader (read help!)" | ||
51 | default "n" | ||
52 | ---help--- | ||
53 | This enables the 'smartcard' reader as installed on the server at | ||
54 | 'www.ant-computing.com'. It was not really a smartcard reader, just | ||
55 | a telephone-card reader. It is left here for demonstration and | ||
56 | experimentation. If you enable this driver, it will be accessible | ||
57 | through character device 10,186. | ||
58 | |||
59 | config PANEL_KEYPAD | 47 | config PANEL_KEYPAD |
60 | depends on PANEL && PANEL_PROFILE="0" | 48 | depends on PANEL && PANEL_PROFILE="0" |
61 | int "Keypad type (0=none, 1=old 6 keys, 2=new 6 keys, 3=Nexcom 4 keys)" | 49 | int "Keypad type (0=none, 1=old 6 keys, 2=new 6 keys, 3=Nexcom 4 keys)" |
diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c index 7f8c1b721162..5ffe269c2382 100644 --- a/drivers/staging/panel/panel.c +++ b/drivers/staging/panel/panel.c | |||
@@ -61,18 +61,13 @@ | |||
61 | #include <asm/uaccess.h> | 61 | #include <asm/uaccess.h> |
62 | #include <asm/system.h> | 62 | #include <asm/system.h> |
63 | 63 | ||
64 | /* smartcard length */ | ||
65 | #define SMARTCARD_BYTES 64 | ||
66 | #define LCD_MINOR 156 | 64 | #define LCD_MINOR 156 |
67 | #define KEYPAD_MINOR 185 | 65 | #define KEYPAD_MINOR 185 |
68 | #define SMARTCARD_MINOR 186 | ||
69 | 66 | ||
70 | #define PANEL_VERSION "0.9.5" | 67 | #define PANEL_VERSION "0.9.5" |
71 | 68 | ||
72 | #define LCD_MAXBYTES 256 /* max burst write */ | 69 | #define LCD_MAXBYTES 256 /* max burst write */ |
73 | 70 | ||
74 | #define SMARTCARD_LOGICAL_DETECTOR "S6" /* D6 wired to SELECT = card inserted */ | ||
75 | |||
76 | #define KEYPAD_BUFFER 64 | 71 | #define KEYPAD_BUFFER 64 |
77 | #define INPUT_POLL_TIME (HZ/50) /* poll the keyboard this every second */ | 72 | #define INPUT_POLL_TIME (HZ/50) /* poll the keyboard this every second */ |
78 | #define KEYPAD_REP_START (10) /* a key starts to repeat after this times INPUT_POLL_TIME */ | 73 | #define KEYPAD_REP_START (10) /* a key starts to repeat after this times INPUT_POLL_TIME */ |
@@ -120,15 +115,6 @@ | |||
120 | #define PIN_SELECP 17 | 115 | #define PIN_SELECP 17 |
121 | #define PIN_NOT_SET 127 | 116 | #define PIN_NOT_SET 127 |
122 | 117 | ||
123 | /* some smartcard-specific signals */ | ||
124 | #define PNL_SC_IO PNL_PD1 /* Warning! inverted output, 0=highZ */ | ||
125 | #define PNL_SC_RST PNL_PD2 | ||
126 | #define PNL_SC_CLK PNL_PD3 | ||
127 | #define PNL_SC_RW PNL_PD4 | ||
128 | #define PNL_SC_ENA PNL_PINITP | ||
129 | #define PNL_SC_IOR PNL_PACK | ||
130 | #define PNL_SC_BITS (PNL_SC_IO | PNL_SC_RST | PNL_SC_CLK | PNL_SC_RW) | ||
131 | |||
132 | #define LCD_FLAG_S 0x0001 | 118 | #define LCD_FLAG_S 0x0001 |
133 | #define LCD_FLAG_ID 0x0002 | 119 | #define LCD_FLAG_ID 0x0002 |
134 | #define LCD_FLAG_B 0x0004 /* blink on */ | 120 | #define LCD_FLAG_B 0x0004 /* blink on */ |
@@ -209,17 +195,12 @@ static pmask_t phys_curr; /* stabilized phys_read (phys_read|phys_read_prev) */ | |||
209 | static pmask_t phys_prev; /* previous phys_curr */ | 195 | static pmask_t phys_prev; /* previous phys_curr */ |
210 | static char inputs_stable; /* 0 means that at least one logical signal needs be computed */ | 196 | static char inputs_stable; /* 0 means that at least one logical signal needs be computed */ |
211 | 197 | ||
212 | /* these variables are specific to the smartcard */ | ||
213 | static __u8 smartcard_data[SMARTCARD_BYTES]; | ||
214 | static int smartcard_ptr; /* pointer to half bytes in smartcard_data */ | ||
215 | |||
216 | /* these variables are specific to the keypad */ | 198 | /* these variables are specific to the keypad */ |
217 | static char keypad_buffer[KEYPAD_BUFFER]; | 199 | static char keypad_buffer[KEYPAD_BUFFER]; |
218 | static int keypad_buflen; | 200 | static int keypad_buflen; |
219 | static int keypad_start; | 201 | static int keypad_start; |
220 | static char keypressed; | 202 | static char keypressed; |
221 | static wait_queue_head_t keypad_read_wait; | 203 | static wait_queue_head_t keypad_read_wait; |
222 | static wait_queue_head_t smartcard_read_wait; | ||
223 | 204 | ||
224 | /* lcd-specific variables */ | 205 | /* lcd-specific variables */ |
225 | static unsigned long int lcd_flags; /* contains the LCD config state */ | 206 | static unsigned long int lcd_flags; /* contains the LCD config state */ |
@@ -304,7 +285,6 @@ static unsigned char lcd_bits[LCD_PORTS][LCD_BITS][BIT_STATES]; | |||
304 | #define DEFAULT_PARPORT 0 | 285 | #define DEFAULT_PARPORT 0 |
305 | #define DEFAULT_LCD LCD_TYPE_OLD | 286 | #define DEFAULT_LCD LCD_TYPE_OLD |
306 | #define DEFAULT_KEYPAD KEYPAD_TYPE_OLD | 287 | #define DEFAULT_KEYPAD KEYPAD_TYPE_OLD |
307 | #define DEFAULT_SMARTCARD 0 | ||
308 | #define DEFAULT_LCD_WIDTH 40 | 288 | #define DEFAULT_LCD_WIDTH 40 |
309 | #define DEFAULT_LCD_BWIDTH 40 | 289 | #define DEFAULT_LCD_BWIDTH 40 |
310 | #define DEFAULT_LCD_HWIDTH 64 | 290 | #define DEFAULT_LCD_HWIDTH 64 |
@@ -335,11 +315,6 @@ static unsigned char lcd_bits[LCD_PORTS][LCD_BITS][BIT_STATES]; | |||
335 | #define DEFAULT_KEYPAD CONFIG_PANEL_KEYPAD | 315 | #define DEFAULT_KEYPAD CONFIG_PANEL_KEYPAD |
336 | #endif | 316 | #endif |
337 | 317 | ||
338 | #ifdef CONFIG_PANEL_SMARTCARD | ||
339 | #undef DEFAULT_SMARTCARD | ||
340 | #define DEFAULT_SMARTCARD 1 | ||
341 | #endif | ||
342 | |||
343 | #ifdef CONFIG_PANEL_LCD | 318 | #ifdef CONFIG_PANEL_LCD |
344 | #undef DEFAULT_LCD | 319 | #undef DEFAULT_LCD |
345 | #define DEFAULT_LCD CONFIG_PANEL_LCD | 320 | #define DEFAULT_LCD CONFIG_PANEL_LCD |
@@ -408,14 +383,12 @@ static unsigned char lcd_bits[LCD_PORTS][LCD_BITS][BIT_STATES]; | |||
408 | #endif /* DEFAULT_PROFILE == 0 */ | 383 | #endif /* DEFAULT_PROFILE == 0 */ |
409 | 384 | ||
410 | /* global variables */ | 385 | /* global variables */ |
411 | static int smartcard_open_cnt; /* #times opened */ | ||
412 | static int keypad_open_cnt; /* #times opened */ | 386 | static int keypad_open_cnt; /* #times opened */ |
413 | static int lcd_open_cnt; /* #times opened */ | 387 | static int lcd_open_cnt; /* #times opened */ |
414 | static struct pardevice *pprt; | 388 | static struct pardevice *pprt; |
415 | 389 | ||
416 | static int lcd_initialized; | 390 | static int lcd_initialized; |
417 | static int keypad_initialized; | 391 | static int keypad_initialized; |
418 | static int smartcard_initialized; | ||
419 | 392 | ||
420 | static int light_tempo; | 393 | static int light_tempo; |
421 | 394 | ||
@@ -430,7 +403,7 @@ static void (*lcd_clear_fast) (void); | |||
430 | static DEFINE_SPINLOCK(pprt_lock); | 403 | static DEFINE_SPINLOCK(pprt_lock); |
431 | static struct timer_list scan_timer; | 404 | static struct timer_list scan_timer; |
432 | 405 | ||
433 | MODULE_DESCRIPTION("Generic parallel port LCD/Keypad/Smartcard driver"); | 406 | MODULE_DESCRIPTION("Generic parallel port LCD/Keypad driver"); |
434 | 407 | ||
435 | static int parport = -1; | 408 | static int parport = -1; |
436 | module_param(parport, int, 0000); | 409 | module_param(parport, int, 0000); |
@@ -478,11 +451,6 @@ module_param(keypad_type, int, 0000); | |||
478 | MODULE_PARM_DESC(keypad_type, | 451 | MODULE_PARM_DESC(keypad_type, |
479 | "Keypad type: 0=none, 1=old 6 keys, 2=new 6+1 keys, 3=nexcom 4 keys"); | 452 | "Keypad type: 0=none, 1=old 6 keys, 2=new 6+1 keys, 3=nexcom 4 keys"); |
480 | 453 | ||
481 | static int smartcard_enabled = -1; | ||
482 | module_param(smartcard_enabled, int, 0000); | ||
483 | MODULE_PARM_DESC(smartcard_enabled, | ||
484 | "Smartcard reader: 0=disabled (default), 1=enabled"); | ||
485 | |||
486 | static int profile = DEFAULT_PROFILE; | 454 | static int profile = DEFAULT_PROFILE; |
487 | module_param(profile, int, 0000); | 455 | module_param(profile, int, 0000); |
488 | MODULE_PARM_DESC(profile, | 456 | MODULE_PARM_DESC(profile, |
@@ -494,7 +462,7 @@ MODULE_PARM_DESC(profile, | |||
494 | * (negative) if the signal is negated. -MAXINT is used to indicate that the | 462 | * (negative) if the signal is negated. -MAXINT is used to indicate that the |
495 | * pin has not been explicitly specified. | 463 | * pin has not been explicitly specified. |
496 | * | 464 | * |
497 | * WARNING! no check will be performed about collisions with keypad/smartcard ! | 465 | * WARNING! no check will be performed about collisions with keypad ! |
498 | */ | 466 | */ |
499 | 467 | ||
500 | static int lcd_e_pin = PIN_NOT_SET; | 468 | static int lcd_e_pin = PIN_NOT_SET; |
@@ -1799,9 +1767,7 @@ static void panel_process_inputs(void) | |||
1799 | 1767 | ||
1800 | static void panel_scan_timer(void) | 1768 | static void panel_scan_timer(void) |
1801 | { | 1769 | { |
1802 | if ((keypad_enabled && keypad_initialized) | 1770 | if (keypad_enabled && keypad_initialized) { |
1803 | || (smartcard_enabled && smartcard_enabled)) { | ||
1804 | |||
1805 | if (spin_trylock(&pprt_lock)) { | 1771 | if (spin_trylock(&pprt_lock)) { |
1806 | phys_scan_contacts(); | 1772 | phys_scan_contacts(); |
1807 | spin_unlock(&pprt_lock); /* no need for the parport anymore */ | 1773 | spin_unlock(&pprt_lock); /* no need for the parport anymore */ |
@@ -1826,121 +1792,6 @@ static void panel_scan_timer(void) | |||
1826 | mod_timer(&scan_timer, jiffies + INPUT_POLL_TIME); | 1792 | mod_timer(&scan_timer, jiffies + INPUT_POLL_TIME); |
1827 | } | 1793 | } |
1828 | 1794 | ||
1829 | /* send a high / low clock impulse of <duration> microseconds high and low */ | ||
1830 | static void smartcard_send_clock(int duration) | ||
1831 | { | ||
1832 | int old; | ||
1833 | |||
1834 | w_dtr(pprt, (old = r_dtr(pprt)) | PNL_SC_CLK); | ||
1835 | udelay(duration); | ||
1836 | w_dtr(pprt, (old & ~PNL_SC_CLK)); | ||
1837 | udelay(duration); | ||
1838 | } | ||
1839 | |||
1840 | static void smartcard_insert(int dummy) | ||
1841 | { | ||
1842 | int ofs; | ||
1843 | |||
1844 | spin_lock(&pprt_lock); | ||
1845 | w_dtr(pprt, (r_dtr(pprt) & ~PNL_SC_BITS)); | ||
1846 | w_ctr(pprt, (r_ctr(pprt) | PNL_SC_ENA)); | ||
1847 | |||
1848 | udelay(30); /* ensure the rst is low at least 30 us */ | ||
1849 | |||
1850 | smartcard_send_clock(100); /* reset address counter */ | ||
1851 | |||
1852 | w_dtr(pprt, r_dtr(pprt) | PNL_SC_RST); | ||
1853 | udelay(30); /* ensure the rst is high at least 30 us */ | ||
1854 | |||
1855 | for (ofs = 0; ofs < SMARTCARD_BYTES; ofs++) { | ||
1856 | int bit, byte; | ||
1857 | byte = 0; | ||
1858 | for (bit = 128; bit > 0; bit >>= 1) { | ||
1859 | if (!(r_str(pprt) & PNL_SC_IOR)) | ||
1860 | byte |= bit; | ||
1861 | smartcard_send_clock(15); /* 15 us are enough for data */ | ||
1862 | } | ||
1863 | smartcard_data[ofs] = byte; | ||
1864 | } | ||
1865 | |||
1866 | w_dtr(pprt, (r_dtr(pprt) & ~PNL_SC_BITS)); | ||
1867 | w_ctr(pprt, (r_ctr(pprt) & ~PNL_SC_ENA)); | ||
1868 | |||
1869 | spin_unlock(&pprt_lock); | ||
1870 | |||
1871 | printk(KERN_INFO "Panel: smart card inserted : %02x%02x%02x%02x%1x\n", | ||
1872 | smartcard_data[2], smartcard_data[3], smartcard_data[4], | ||
1873 | smartcard_data[5], smartcard_data[6] >> 4); | ||
1874 | keypad_send_key("CardIn\n", 7); | ||
1875 | } | ||
1876 | |||
1877 | static void smartcard_remove(int dummy) | ||
1878 | { | ||
1879 | printk(KERN_INFO "Panel: smart card removed : %02x%02x%02x%02x%1x\n", | ||
1880 | smartcard_data[2], smartcard_data[3], smartcard_data[4], | ||
1881 | smartcard_data[5], smartcard_data[6] >> 4); | ||
1882 | memset(smartcard_data, 0, sizeof(smartcard_data)); | ||
1883 | keypad_send_key("CardOut\n", 8); | ||
1884 | } | ||
1885 | |||
1886 | /* | ||
1887 | * These are the file operation function for user access to /dev/smartcard | ||
1888 | */ | ||
1889 | |||
1890 | static ssize_t smartcard_read(struct file *file, | ||
1891 | char *buf, size_t count, loff_t *ppos) | ||
1892 | { | ||
1893 | |||
1894 | unsigned i = *ppos; | ||
1895 | char *tmp = buf; | ||
1896 | |||
1897 | for (; count-- > 0 && (smartcard_ptr < 9); ++i, ++tmp, ++smartcard_ptr) { | ||
1898 | if (smartcard_ptr & 1) | ||
1899 | put_user('0' + | ||
1900 | (smartcard_data[2 + (smartcard_ptr >> 1)] & | ||
1901 | 0xF), tmp); | ||
1902 | else | ||
1903 | put_user('0' + | ||
1904 | (smartcard_data[2 + (smartcard_ptr >> 1)] >> | ||
1905 | 4), tmp); | ||
1906 | } | ||
1907 | *ppos = i; | ||
1908 | |||
1909 | return tmp - buf; | ||
1910 | } | ||
1911 | |||
1912 | static int smartcard_open(struct inode *inode, struct file *file) | ||
1913 | { | ||
1914 | |||
1915 | if (smartcard_open_cnt) | ||
1916 | return -EBUSY; /* open only once at a time */ | ||
1917 | |||
1918 | if (file->f_mode & FMODE_WRITE) /* device is read-only */ | ||
1919 | return -EPERM; | ||
1920 | |||
1921 | smartcard_ptr = 0; /* flush the buffer on opening */ | ||
1922 | smartcard_open_cnt++; | ||
1923 | return 0; | ||
1924 | } | ||
1925 | |||
1926 | static int smartcard_release(struct inode *inode, struct file *file) | ||
1927 | { | ||
1928 | smartcard_open_cnt--; | ||
1929 | return 0; | ||
1930 | } | ||
1931 | |||
1932 | static struct file_operations smartcard_fops = { | ||
1933 | .read = smartcard_read, /* read */ | ||
1934 | .open = smartcard_open, /* open */ | ||
1935 | .release = smartcard_release, /* close */ | ||
1936 | }; | ||
1937 | |||
1938 | static struct miscdevice smartcard_dev = { | ||
1939 | SMARTCARD_MINOR, | ||
1940 | "smartcard", | ||
1941 | &smartcard_fops | ||
1942 | }; | ||
1943 | |||
1944 | static void init_scan_timer(void) | 1795 | static void init_scan_timer(void) |
1945 | { | 1796 | { |
1946 | if (scan_timer.function != NULL) | 1797 | if (scan_timer.function != NULL) |
@@ -2037,6 +1888,7 @@ static struct logical_input *panel_bind_key(char *name, char *press, | |||
2037 | return key; | 1888 | return key; |
2038 | } | 1889 | } |
2039 | 1890 | ||
1891 | #if 0 | ||
2040 | /* tries to bind a callback function to the signal name <name>. The function | 1892 | /* tries to bind a callback function to the signal name <name>. The function |
2041 | * <press_fct> will be called with the <press_data> arg when the signal is | 1893 | * <press_fct> will be called with the <press_data> arg when the signal is |
2042 | * activated, and so on for <release_fct>/<release_data> | 1894 | * activated, and so on for <release_fct>/<release_data> |
@@ -2071,6 +1923,7 @@ static struct logical_input *panel_bind_callback(char *name, | |||
2071 | list_add(&callback->list, &logical_inputs); | 1923 | list_add(&callback->list, &logical_inputs); |
2072 | return callback; | 1924 | return callback; |
2073 | } | 1925 | } |
1926 | #endif | ||
2074 | 1927 | ||
2075 | static void keypad_init(void) | 1928 | static void keypad_init(void) |
2076 | { | 1929 | { |
@@ -2091,16 +1944,6 @@ static void keypad_init(void) | |||
2091 | keypad_initialized = 1; | 1944 | keypad_initialized = 1; |
2092 | } | 1945 | } |
2093 | 1946 | ||
2094 | static void smartcard_init(void) | ||
2095 | { | ||
2096 | init_waitqueue_head(&smartcard_read_wait); | ||
2097 | |||
2098 | panel_bind_callback(SMARTCARD_LOGICAL_DETECTOR, &smartcard_insert, 0, | ||
2099 | &smartcard_remove, 0); | ||
2100 | init_scan_timer(); | ||
2101 | smartcard_enabled = 1; | ||
2102 | } | ||
2103 | |||
2104 | /**************************************************/ | 1947 | /**************************************************/ |
2105 | /* device initialization */ | 1948 | /* device initialization */ |
2106 | /**************************************************/ | 1949 | /**************************************************/ |
@@ -2168,11 +2011,6 @@ static void panel_attach(struct parport *port) | |||
2168 | keypad_init(); | 2011 | keypad_init(); |
2169 | misc_register(&keypad_dev); | 2012 | misc_register(&keypad_dev); |
2170 | } | 2013 | } |
2171 | |||
2172 | if (smartcard_enabled) { | ||
2173 | smartcard_init(); | ||
2174 | misc_register(&smartcard_dev); | ||
2175 | } | ||
2176 | } | 2014 | } |
2177 | 2015 | ||
2178 | static void panel_detach(struct parport *port) | 2016 | static void panel_detach(struct parport *port) |
@@ -2187,9 +2025,6 @@ static void panel_detach(struct parport *port) | |||
2187 | return; | 2025 | return; |
2188 | } | 2026 | } |
2189 | 2027 | ||
2190 | if (smartcard_enabled && smartcard_initialized) | ||
2191 | misc_deregister(&smartcard_dev); | ||
2192 | |||
2193 | if (keypad_enabled && keypad_initialized) | 2028 | if (keypad_enabled && keypad_initialized) |
2194 | misc_deregister(&keypad_dev); | 2029 | misc_deregister(&keypad_dev); |
2195 | 2030 | ||
@@ -2225,16 +2060,12 @@ int panel_init(void) | |||
2225 | case PANEL_PROFILE_CUSTOM: /* custom profile */ | 2060 | case PANEL_PROFILE_CUSTOM: /* custom profile */ |
2226 | if (keypad_type < 0) | 2061 | if (keypad_type < 0) |
2227 | keypad_type = DEFAULT_KEYPAD; | 2062 | keypad_type = DEFAULT_KEYPAD; |
2228 | if (smartcard_enabled < 0) | ||
2229 | smartcard_enabled = DEFAULT_SMARTCARD; | ||
2230 | if (lcd_type < 0) | 2063 | if (lcd_type < 0) |
2231 | lcd_type = DEFAULT_LCD; | 2064 | lcd_type = DEFAULT_LCD; |
2232 | break; | 2065 | break; |
2233 | case PANEL_PROFILE_OLD: /* 8 bits, 2*16, old keypad */ | 2066 | case PANEL_PROFILE_OLD: /* 8 bits, 2*16, old keypad */ |
2234 | if (keypad_type < 0) | 2067 | if (keypad_type < 0) |
2235 | keypad_type = KEYPAD_TYPE_OLD; | 2068 | keypad_type = KEYPAD_TYPE_OLD; |
2236 | if (smartcard_enabled < 0) | ||
2237 | smartcard_enabled = 0; | ||
2238 | if (lcd_type < 0) | 2069 | if (lcd_type < 0) |
2239 | lcd_type = LCD_TYPE_OLD; | 2070 | lcd_type = LCD_TYPE_OLD; |
2240 | if (lcd_width < 0) | 2071 | if (lcd_width < 0) |
@@ -2245,32 +2076,24 @@ int panel_init(void) | |||
2245 | case PANEL_PROFILE_NEW: /* serial, 2*16, new keypad */ | 2076 | case PANEL_PROFILE_NEW: /* serial, 2*16, new keypad */ |
2246 | if (keypad_type < 0) | 2077 | if (keypad_type < 0) |
2247 | keypad_type = KEYPAD_TYPE_NEW; | 2078 | keypad_type = KEYPAD_TYPE_NEW; |
2248 | if (smartcard_enabled < 0) | ||
2249 | smartcard_enabled = 1; | ||
2250 | if (lcd_type < 0) | 2079 | if (lcd_type < 0) |
2251 | lcd_type = LCD_TYPE_KS0074; | 2080 | lcd_type = LCD_TYPE_KS0074; |
2252 | break; | 2081 | break; |
2253 | case PANEL_PROFILE_HANTRONIX: /* 8 bits, 2*16 hantronix-like, no keypad */ | 2082 | case PANEL_PROFILE_HANTRONIX: /* 8 bits, 2*16 hantronix-like, no keypad */ |
2254 | if (keypad_type < 0) | 2083 | if (keypad_type < 0) |
2255 | keypad_type = KEYPAD_TYPE_NONE; | 2084 | keypad_type = KEYPAD_TYPE_NONE; |
2256 | if (smartcard_enabled < 0) | ||
2257 | smartcard_enabled = 0; | ||
2258 | if (lcd_type < 0) | 2085 | if (lcd_type < 0) |
2259 | lcd_type = LCD_TYPE_HANTRONIX; | 2086 | lcd_type = LCD_TYPE_HANTRONIX; |
2260 | break; | 2087 | break; |
2261 | case PANEL_PROFILE_NEXCOM: /* generic 8 bits, 2*16, nexcom keypad, eg. Nexcom. */ | 2088 | case PANEL_PROFILE_NEXCOM: /* generic 8 bits, 2*16, nexcom keypad, eg. Nexcom. */ |
2262 | if (keypad_type < 0) | 2089 | if (keypad_type < 0) |
2263 | keypad_type = KEYPAD_TYPE_NEXCOM; | 2090 | keypad_type = KEYPAD_TYPE_NEXCOM; |
2264 | if (smartcard_enabled < 0) | ||
2265 | smartcard_enabled = 0; | ||
2266 | if (lcd_type < 0) | 2091 | if (lcd_type < 0) |
2267 | lcd_type = LCD_TYPE_NEXCOM; | 2092 | lcd_type = LCD_TYPE_NEXCOM; |
2268 | break; | 2093 | break; |
2269 | case PANEL_PROFILE_LARGE: /* 8 bits, 2*40, old keypad */ | 2094 | case PANEL_PROFILE_LARGE: /* 8 bits, 2*40, old keypad */ |
2270 | if (keypad_type < 0) | 2095 | if (keypad_type < 0) |
2271 | keypad_type = KEYPAD_TYPE_OLD; | 2096 | keypad_type = KEYPAD_TYPE_OLD; |
2272 | if (smartcard_enabled < 0) | ||
2273 | smartcard_enabled = 0; | ||
2274 | if (lcd_type < 0) | 2097 | if (lcd_type < 0) |
2275 | lcd_type = LCD_TYPE_OLD; | 2098 | lcd_type = LCD_TYPE_OLD; |
2276 | break; | 2099 | break; |
@@ -2303,7 +2126,8 @@ int panel_init(void) | |||
2303 | return -EIO; | 2126 | return -EIO; |
2304 | } | 2127 | } |
2305 | 2128 | ||
2306 | if (!lcd_enabled && !keypad_enabled && !smartcard_enabled) { /* no device enabled, let's release the parport */ | 2129 | if (!lcd_enabled && !keypad_enabled) { |
2130 | /* no device enabled, let's release the parport */ | ||
2307 | if (pprt) { | 2131 | if (pprt) { |
2308 | parport_release(pprt); | 2132 | parport_release(pprt); |
2309 | parport_unregister_device(pprt); | 2133 | parport_unregister_device(pprt); |
@@ -2343,9 +2167,6 @@ static void __exit panel_cleanup_module(void) | |||
2343 | if (keypad_enabled) | 2167 | if (keypad_enabled) |
2344 | misc_deregister(&keypad_dev); | 2168 | misc_deregister(&keypad_dev); |
2345 | 2169 | ||
2346 | if (smartcard_enabled) | ||
2347 | misc_deregister(&smartcard_dev); | ||
2348 | |||
2349 | if (lcd_enabled) { | 2170 | if (lcd_enabled) { |
2350 | panel_lcd_print("\x0cLCD driver " PANEL_VERSION | 2171 | panel_lcd_print("\x0cLCD driver " PANEL_VERSION |
2351 | "\nunloaded.\x1b[Lc\x1b[Lb\x1b[L-"); | 2172 | "\nunloaded.\x1b[Lc\x1b[Lb\x1b[L-"); |