From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753558AbcAMB4W (ORCPT ); Tue, 12 Jan 2016 20:56:22 -0500 Received: from mail-pa0-f65.google.com ([209.85.220.65]:36085 "EHLO mail-pa0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751121AbcAMB4U (ORCPT ); Tue, 12 Jan 2016 20:56:20 -0500 Subject: Re: [PATCH 2/2] gpio-f7188x: filter non-export gpio for F81866 To: Simon Guinot References: <1452584499-13939-1-git-send-email-hpeter+linux_kernel@gmail.com> <1452584499-13939-3-git-send-email-hpeter+linux_kernel@gmail.com> <20160112153636.GA7731@kw.sim.vm.gnt> Cc: linus.walleij@linaro.org, gnurou@gmail.com, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, tom_tsai@fintek.com.tw, peter_hong@fintek.com.tw, Peter Hung From: Peter Hung Message-ID: <5695AEC4.7040907@gmail.com> Date: Wed, 13 Jan 2016 09:56:20 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160112153636.GA7731@kw.sim.vm.gnt> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Simon, >> @@ -351,6 +485,15 @@ static int f7188x_gpio_probe(struct platform_device *pdev) >> for (i = 0; i < data->nr_bank; i++) { >> struct f7188x_gpio_bank *bank = &data->bank[i]; >> >> + /* >> + * Dont export GPIO sysfs if pin set is not enable by MB >> + * manufacturer. > > What does MB stands for ? The MB is stands for "Motherboard", Due to the limit of 80 words length, I use the abbreviation. >> + */ >> + if (sio->type == f81866 && f81866_verify_gpioset(sio->addr, i)) >> + continue; > > This whole filtering mechanism relies on the fact that the multiplexing > configuration has been correctly applied by the BIOS (if applied at > all). But I wonder if it is often the case. For example, I have several > boards for which it is not true. And to make the GPIOs available, I need > first to fix the multiplexing pin configuration of the Super I/O. > > Maybe it would be more correct to rely on the hardware description of a > board (Device Tree or ACPI) to decide which GPIO bank can be enabled or > not. That's good for control by Device Tree or ACPI. IMO, we shouldn't export GPIOs not enabled if the BIOS had written wrong configuration to SuperIO, but it's only my opinion. Should I do filter for this? Thanks for your advices. -- With Best Regards, Peter Hung