Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753762AbbLOC4Z (ORCPT ); Mon, 14 Dec 2015 21:56:25 -0500 Received: from mail-pf0-f180.google.com ([209.85.192.180]:36453 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753724AbbLOC4L (ORCPT ); Mon, 14 Dec 2015 21:56:11 -0500 Subject: Re: [PATCH RESEND 1/1] serial: 8250_pci: Fix real serial port count for F81504/508/512 To: Andy Shevchenko References: <1448952881-7871-1-git-send-email-hpeter+linux_kernel@gmail.com> Cc: Greg Kroah-Hartman , jslaby@suse.com, "linux-serial@vger.kernel.org" , "linux-kernel@vger.kernel.org" , tom_tsai@fintek.com.tw, Peter H , Peter Hung From: Peter Hung Message-ID: <566F8148.5020600@gmail.com> Date: Tue, 15 Dec 2015 10:56:08 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1436 Lines: 46 Hello, Andy Shevchenko 於 2015/12/13 上午 09:08 寫道: > On Tue, Dec 1, 2015 at 8:54 AM, Peter Hung 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/