aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorDarren Hart <dvhart@linux.intel.com>2012-03-09 12:51:50 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-09 15:43:20 -0500
commit2a44feb20bbe3db3b86bc5d976c8647cfda48588 (patch)
tree15afe47ef4d5421daf2da5ace173762cb391920c /drivers/tty
parent077175f08e365629312ce32918e0c8047151763d (diff)
pch_uart: Add user_uartclk parameter
For cases where boards with non-default clocks are not yet added to the kernel or when the clock varies across hardware revisions, it is useful to be able to specify the UART clock on the kernel command line. Add the user_uartclk parameter and prefer it, if set, to the default and board specific UART clock settings. Specify user_uartclock on the command-line with "pch_uart.user_uartclk=48000000". Signed-off-by: Darren Hart <dvhart@linux.intel.com> CC: Tomoya MORINAGA <tomoya.rohm@gmail.com> CC: Feng Tang <feng.tang@intel.com> CC: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/pch_uart.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index 88a1be058a44..46f6fbf41d91 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -295,6 +295,7 @@ static struct pch_uart_driver_data drv_dat[] = {
295static struct eg20t_port *pch_uart_ports[PCH_UART_NR]; 295static struct eg20t_port *pch_uart_ports[PCH_UART_NR];
296#endif 296#endif
297static unsigned int default_baud = 9600; 297static unsigned int default_baud = 9600;
298static unsigned int user_uartclk = 0;
298static const int trigger_level_256[4] = { 1, 64, 128, 224 }; 299static const int trigger_level_256[4] = { 1, 64, 128, 224 };
299static const int trigger_level_64[4] = { 1, 16, 32, 56 }; 300static const int trigger_level_64[4] = { 1, 16, 32, 56 };
300static const int trigger_level_16[4] = { 1, 4, 8, 14 }; 301static const int trigger_level_16[4] = { 1, 4, 8, 14 };
@@ -372,6 +373,9 @@ static int pch_uart_get_uartclk(void)
372{ 373{
373 const char *cmp; 374 const char *cmp;
374 375
376 if (user_uartclk)
377 return user_uartclk;
378
375 cmp = dmi_get_system_info(DMI_BOARD_NAME); 379 cmp = dmi_get_system_info(DMI_BOARD_NAME);
376 if (cmp && strstr(cmp, "CM-iTC")) 380 if (cmp && strstr(cmp, "CM-iTC"))
377 return CMITC_UARTCLK; 381 return CMITC_UARTCLK;
@@ -1860,3 +1864,4 @@ module_exit(pch_uart_module_exit);
1860MODULE_LICENSE("GPL v2"); 1864MODULE_LICENSE("GPL v2");
1861MODULE_DESCRIPTION("Intel EG20T PCH UART PCI Driver"); 1865MODULE_DESCRIPTION("Intel EG20T PCH UART PCI Driver");
1862module_param(default_baud, uint, S_IRUGO); 1866module_param(default_baud, uint, S_IRUGO);
1867module_param(user_uartclk, uint, S_IRUGO);