public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Hung <hpeter@gmail.com>
To: Simon Guinot <simon.guinot@sequanux.org>
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 <hpeter+linux_kernel@gmail.com>
Subject: Re: [PATCH 2/2] gpio-f7188x: filter non-export gpio for F81866
Date: Wed, 13 Jan 2016 09:56:20 +0800	[thread overview]
Message-ID: <5695AEC4.7040907@gmail.com> (raw)
In-Reply-To: <20160112153636.GA7731@kw.sim.vm.gnt>

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

      reply	other threads:[~2016-01-13  1:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-12  7:41 [PATCH 0/2] gpio-f7188x: Add F81886 gpio function Peter Hung
2016-01-12  7:41 ` [PATCH 1/2] gpio-f7188x: add Fintek F81866 SuperIO support Peter Hung
2016-01-12  7:41 ` [PATCH 2/2] gpio-f7188x: filter non-export gpio for F81866 Peter Hung
2016-01-12  9:33   ` Andy Shevchenko
2016-01-13  2:03     ` Peter Hung
2016-01-12 15:36   ` Simon Guinot
2016-01-13  1:56     ` Peter Hung [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5695AEC4.7040907@gmail.com \
    --to=hpeter@gmail.com \
    --cc=gnurou@gmail.com \
    --cc=hpeter+linux_kernel@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter_hong@fintek.com.tw \
    --cc=simon.guinot@sequanux.org \
    --cc=tom_tsai@fintek.com.tw \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox