[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1456225517.13244.41.camel@linux.intel.com>
Date: Tue, 23 Feb 2016 13:05:17 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Peter Hung <hpeter@...il.com>, linus.walleij@...aro.org,
gnurou@...il.com, gregkh@...uxfoundation.org,
paul.gortmaker@...driver.com, lee.jones@...aro.org,
jslaby@...e.com, gnomes@...rguk.ukuu.org.uk,
peter_hong@...tek.com.tw
Cc: heikki.krogerus@...ux.intel.com, peter@...leysoftware.com,
soeren.grunewald@...y.de, udknight@...il.com,
adam.lee@...onical.com, arnd@...db.de, manabian@...il.com,
scottwood@...escale.com, yamada.masahiro@...ionext.com,
paul.burton@...tec.com, mans@...sr.com, matthias.bgg@...il.com,
ralf@...ux-mips.org, linux-kernel@...r.kernel.org,
linux-gpio@...r.kernel.org, linux-serial@...r.kernel.org,
tom_tsai@...tek.com.tw, Peter Hung <hpeter+linux_kernel@...il.com>
Subject: Re: [PATCH V4 1/4] mfd: f81504-core: Add Fintek F81504/508/512
PCIE-to-UART/GPIO core support
On Tue, 2016-02-23 at 14:30 +0800, Peter Hung wrote:
> The Fintek F81504/508/512 had implemented the basic serial port
> function in
> 8250_pci.c. We try to implement high baudrate & GPIOLIB with a spilt
> file
> 8250_f81504.c, but it seems too complex to add GPIOLIB.
[...]
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -345,6 +345,18 @@ config HTC_I2CPLD
> This device provides input and output GPIOs through an I2C
> interface to one or more sub-chips.
>
> +config MFD_FINTEK_F81504_CORE
> + tristate "Fintek F81504/508/512 PCIE-to-UART/GPIO MFD
> support"
> + depends on PCI
> + select MFD_CORE
> + default SERIAL_8250
SERIAL_8250_PCI ?
> +static bool f81504_is_gpio(unsigned int idx, u8 gpio_en)
> +{
> + unsigned int i;
> +
> + /* Find every port to check is multi-function port */
> + for (i = 0; i < ARRAY_SIZE(fintek_gpio_mapping); i++) {
> + if (fintek_gpio_mapping[i] != idx || !(gpio_en &
> BIT(i)))
> + continue;
> +
> + /*
> + * This port is multi-function and enabled as gpio
> mode.
> + * So we'll not configure it as serial port.
> + */
> + return true;
Perhaps
if (fintek_gpio_mapping[i] == idx && (gpio_en & BIT(i)))
return true;
?
> + }
> +
> + return false;
> +}
--
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Intel Finland Oy
Powered by blists - more mailing lists