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


Groups > linux.kernel > #1291802

Re: [PATCH RESEND 1/1] serial: 8250_pci: Fix real serial port count for F81504/508/512

From Peter Hung <hpeter@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH RESEND 1/1] serial: 8250_pci: Fix real serial port count for F81504/508/512
Date 2015-12-15 04:00 +0100
Message-ID <qFO0h-6pG-1@gated-at.bofh.it> (permalink)
References <qAN4R-67m-9@gated-at.bofh.it> <qF3kJ-1tM-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hello,

Andy Shevchenko 於 2015/12/13 上午 09:08 寫道:
> On Tue, Dec 1, 2015 at 8:54 AM, Peter Hung <hpeter@gmail.com> wrote:

> First of all, maybe you can consider to split this part of the driver
> to separate one? (Like we did for 8250_mid.c). It seems 8250_pci is
> too bloated. But it's just an idea, maybe for future.

It's a good idea. Our PCI-to-UART device is a multifunctional
(GPIO/UART) board, I need try to split it from 8250_pci.c to
implements all functions.

>>
>> +/* The device is multi-function with UART & GPIO */
>> +static u8 fintek_gpio_mapping[] = {2, 3, 8, 9, 10, 11};
>
> Clearly you have bit combination here
> Bit 1: 1
> Bit 3: 1
>
> So, mask as 0x0a shall cover this IIAC.

IMO, It maybe wrong. If we checked only with 0x0a mask,
the 0x06 & 0x07 will be passed.

I had try with k-map to reduce from 0~11 (12~15 for don't care).
The final boolean value is a + c b(bar) for a is MSB.

>> -       config_base = 0x40 + 0x08 * idx;
>> +       switch (pdev->device) {
>> +       case 0x1104: /* 4 ports */
>
> Maybe you can introduce constants for IDs.

I'll make the magic numbers with #define marco.

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

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


Thread

Re: [PATCH RESEND 1/1] serial: 8250_pci: Fix real serial port count  for F81504/508/512 Andy Shevchenko <andy.shevchenko@gmail.com> - 2015-12-13 02:10 +0100
  Re: [PATCH RESEND 1/1] serial: 8250_pci: Fix real serial port count  for F81504/508/512 Peter Hung <hpeter@gmail.com> - 2015-12-15 04:00 +0100
    Re: [PATCH RESEND 1/1] serial: 8250_pci: Fix real serial port count  for F81504/508/512 Andy Shevchenko <andy.shevchenko@gmail.com> - 2015-12-20 18:20 +0100
  Re: [PATCH RESEND 1/1] serial: 8250_pci: Fix real serial port count  for F81504/508/512 Peter Hung <hpeter@gmail.com> - 2015-12-28 04:50 +0100

csiph-web