Re: [PATCH V4 1/4] mfd: f81504-core: Add Fintek F81504/508/512 PCIE-to-UART/GPIO core support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Andy,

Andy Shevchenko 於 2016/2/23 下午 07:05 寫道:
On Tue, 2016-02-23 at 14:30 +0800, Peter Hung wrote:
+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 ?

In my opinion, 8250_pci & f81504_core are independently drivers.
So I'll set the default to SERIAL_8250.

+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;

Your code is more simple and readable. I'll change it for V5

Thanks for your advices.
--
With Best Regards,
Peter Hung
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux