From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758100Ab2CHS4W (ORCPT ); Thu, 8 Mar 2012 13:56:22 -0500 Received: from mail-iy0-f174.google.com ([209.85.210.174]:65486 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757284Ab2CHS4U (ORCPT ); Thu, 8 Mar 2012 13:56:20 -0500 Date: Thu, 8 Mar 2012 10:56:15 -0800 From: Greg Kroah-Hartman To: Darren Hart Cc: Linux Kernel Mailing List , Tomoya MORINAGA , Feng Tang , Alan Cox , linux-serial@vger.kernel.org Subject: Re: [PATCH 3/4] pch_uart: Add user_uartclk parameter Message-ID: <20120308185615.GA13866@kroah.com> References: <8d2f6dc994198252c7afe323bba6aa6b4cd3dd83.1330539597.git.dvhart@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8d2f6dc994198252c7afe323bba6aa6b4cd3dd83.1330539597.git.dvhart@linux.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 29, 2012 at 10:24:46AM -0800, Darren Hart wrote: > 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 > CC: Tomoya MORINAGA > CC: Feng Tang > CC: Alan Cox > --- > drivers/tty/serial/pch_uart.c | 5 +++++ > 1 files changed, 5 insertions(+), 0 deletions(-) > > diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c > index 3a2b0ae..105d982 100644 > --- a/drivers/tty/serial/pch_uart.c > +++ b/drivers/tty/serial/pch_uart.c > @@ -290,6 +290,7 @@ static struct pch_uart_driver_data drv_dat[] = { > static struct eg20t_port *pch_uart_ports[PCH_UART_NR]; > #endif > static unsigned int default_baud = 9600; > +static unsigned int user_uartclk = 0; > static const int trigger_level_256[4] = { 1, 64, 128, 224 }; > static const int trigger_level_64[4] = { 1, 16, 32, 56 }; > static const int trigger_level_16[4] = { 1, 4, 8, 14 }; > @@ -300,6 +301,9 @@ static int pch_uart_get_uartclk(void) > { > const char *cmp; > > + if (user_uartclk) > + return user_uartclk; > + > cmp = dmi_get_system_info(DMI_BOARD_NAME); > if (cmp && strstr(cmp, "CM-iTC")) > return CMITC_UARTCLK; > @@ -1799,3 +1803,4 @@ module_exit(pch_uart_module_exit); > MODULE_LICENSE("GPL v2"); > MODULE_DESCRIPTION("Intel EG20T PCH UART PCI Driver"); > module_param(default_baud, uint, S_IRUGO); > +module_param(user_uartclk, uint, S_IRUGO); I don't object to this, but you should provide some documentation on what this option does. How about a follow-on patch using MODULE_PARM_DESC() for both of these options to help people out with how they should be used? thanks, greg k-h