Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1320501

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

From One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
Newsgroups linux.kernel
Subject Re: [PATCH V2 1/4] mfd: f81504-core: Add Fintek F81504/508/512 PCIE-to-UART/GPIO core support
Date 2016-01-28 11:10 +0100
Message-ID <qVRGz-1R3-37@gated-at.bofh.it> (permalink)
References <qVR3Q-1j6-5@gated-at.bofh.it> <qVR3Q-1j6-9@gated-at.bofh.it>
Organization Intel Corporation

Show all headers | View raw


> +config MFD_FINTEK_F81504_CORE
> +        tristate "Fintek F81504/508/512 PCIE-to-UART/GPIO MFD support"
> +        depends on PCI
> +        select MFD_CORE
> +        default y
> +        help
> +          This driver generate F81504/508/512 UART & GPIO platform
This driver provides the F81504/508/512 UART & GPIO platform
> +          device. It should enable CONFIG_GPIO_F81504 to get GPIOLIB
devices. You should enable CONFIG_GPIO_F81504 to get GPIOLIB
> +          support and CONFIG_8250_F81504 to get serial ports support.
port rather than ports

> +          Please bulit-in kernel if you need early console support.
This driver needs to be built into the kernel to use early console
support.



> +	switch (dev->device) {
> +	case FINTEK_F81504: /* 4 ports */
> +		/* F81504 max 2 sets of GPIO, others are max 6 sets*/
> +		gpio_en &= 0x03;
> +	case FINTEK_F81508: /* 8 ports */
> +		max_port = dev->device & 0xff;

If that is meant to fall through from F81504 into F81508 it's worth
commenting, otherwise someone reviewing the code can't always be sure it
was intentional.

> +		break;
> +	case FINTEK_F81512: /* 12 ports */
> +		max_port = 12;
> +		break;
> +	default:
> +		return -EINVAL;
> +	}
> +
> +	/* rewrite GPIO Mode setting */
> +	pci_write_config_byte(dev, F81504_GPIO_ENABLE_REG, gpio_en & 0x3f);
> +	pci_write_config_byte(dev, F81504_GPIO_MODE_REG, ~gpio_en & 0x3f);
> +
> +	/* Get the UART IO address dispatch from the BIOS */
> +	pci_read_config_dword(dev, 0x24, &bar_data[0]);
> +	pci_read_config_dword(dev, 0x20, &bar_data[1]);
> +	pci_read_config_dword(dev, 0x1c, &bar_data[2]);

Take these from the pci device itself. On some non PC platforms the
values in the pci bar may be remapped by bridges and not give you the
true answer.

	pci_resource_start(dev, barnumber)


Alan

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH V2 1/4] mfd: f81504-core: Add Fintek F81504/508/512 PCIE-to-UART/GPIO core support Peter Hung <hpeter@gmail.com> - 2016-01-28 10:30 +0100
  Re: [PATCH V2 1/4] mfd: f81504-core: Add Fintek F81504/508/512  PCIE-to-UART/GPIO core support One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk> - 2016-01-28 11:10 +0100
    Re: [PATCH V2 1/4] mfd: f81504-core: Add Fintek F81504/508/512  PCIE-to-UART/GPIO core support Peter Hung <hpeter@gmail.com> - 2016-01-29 03:30 +0100
  Re: [PATCH V2 1/4] mfd: f81504-core: Add Fintek F81504/508/512  PCIE-to-UART/GPIO core support Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-01-28 13:00 +0100
    Re: [PATCH V2 1/4] mfd: f81504-core: Add Fintek F81504/508/512  PCIE-to-UART/GPIO core support Peter Hung <hpeter@gmail.com> - 2016-01-29 07:00 +0100
      Re: [PATCH V2 1/4] mfd: f81504-core: Add Fintek F81504/508/512  PCIE-to-UART/GPIO core support Lee Jones <lee.jones@linaro.org> - 2016-01-29 09:30 +0100
        Re: [PATCH V2 1/4] mfd: f81504-core: Add Fintek F81504/508/512  PCIE-to-UART/GPIO core support Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-01-29 13:50 +0100
          Re: [PATCH V2 1/4] mfd: f81504-core: Add Fintek F81504/508/512  PCIE-to-UART/GPIO core support Lee Jones <lee.jones@linaro.org> - 2016-02-01 09:30 +0100
      Re: [PATCH V2 1/4] mfd: f81504-core: Add Fintek F81504/508/512  PCIE-to-UART/GPIO core support Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-01-29 14:50 +0100
        Re: [PATCH V2 1/4] mfd: f81504-core: Add Fintek F81504/508/512  PCIE-to-UART/GPIO core support Peter Hung <hpeter@gmail.com> - 2016-02-01 04:00 +0100

csiph-web