All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Peter Hung <hpeter@gmail.com>,
	linus.walleij@linaro.org, gnurou@gmail.com,
	gregkh@linuxfoundation.org, paul.gortmaker@windriver.com,
	lee.jones@linaro.org, jslaby@suse.com,
	gnomes@lxorguk.ukuu.org.uk, peter_hong@fintek.com.tw
Cc: heikki.krogerus@linux.intel.com, peter@hurleysoftware.com,
	soeren.grunewald@desy.de, udknight@gmail.com,
	adam.lee@canonical.com, arnd@arndb.de, manabian@gmail.com,
	scottwood@freescale.com, yamada.masahiro@socionext.com,
	paul.burton@imgtec.com, mans@mansr.com, matthias.bgg@gmail.com,
	ralf@linux-mips.org, linux-kernel@vger.kernel.org,
	linux-gpio@vger.kernel.org, linux-serial@vger.kernel.org,
	tom_tsai@fintek.com.tw,
	Peter Hung <hpeter+linux_kernel@gmail.com>
Subject: Re: [PATCH V4 1/4] mfd: f81504-core: Add Fintek F81504/508/512 PCIE-to-UART/GPIO core support
Date: Tue, 23 Feb 2016 13:05:17 +0200	[thread overview]
Message-ID: <1456225517.13244.41.camel@linux.intel.com> (raw)
In-Reply-To: <1456209003-22396-2-git-send-email-hpeter+linux_kernel@gmail.com>

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@linux.intel.com>
Intel Finland Oy

  reply	other threads:[~2016-02-23 11:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-23  6:29 [PATCH V4 0/4] Transform Fintek PCIE driver from 8250 to MFD Peter Hung
2016-02-23  6:30 ` [PATCH V4 1/4] mfd: f81504-core: Add Fintek F81504/508/512 PCIE-to-UART/GPIO core support Peter Hung
2016-02-23 11:05   ` Andy Shevchenko [this message]
2016-03-02  7:34     ` Peter Hung
2016-03-02  7:34       ` Peter Hung
2016-02-23  6:30 ` [PATCH V4 2/4] gpio: gpio-f81504: Add Fintek F81504/508/512 PCIE-to-UART/GPIO GPIOLIB support Peter Hung
2016-02-25  9:59   ` Linus Walleij
2016-02-25  9:59     ` Linus Walleij
2016-02-23  6:30 ` [PATCH V4 3/4] 8250: 8250_f81504: Add Fintek F81504/508/512 PCIE-to-UART/GPIO UART support Peter Hung
2016-02-23  6:30 ` [PATCH V4 4/4] serial: 8250_pci: Remove Fintek F81504/508/512 UART driver Peter Hung

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1456225517.13244.41.camel@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=adam.lee@canonical.com \
    --cc=arnd@arndb.de \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=gnurou@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=hpeter+linux_kernel@gmail.com \
    --cc=hpeter@gmail.com \
    --cc=jslaby@suse.com \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=manabian@gmail.com \
    --cc=mans@mansr.com \
    --cc=matthias.bgg@gmail.com \
    --cc=paul.burton@imgtec.com \
    --cc=paul.gortmaker@windriver.com \
    --cc=peter@hurleysoftware.com \
    --cc=peter_hong@fintek.com.tw \
    --cc=ralf@linux-mips.org \
    --cc=scottwood@freescale.com \
    --cc=soeren.grunewald@desy.de \
    --cc=tom_tsai@fintek.com.tw \
    --cc=udknight@gmail.com \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.