linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: lkundrak@v3.sk, Stephen Boyd <swboyd@chromium.org>,
	Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Michael Turquette <mturquette@baylibre.com>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Stephen Boyd <sboyd@kernel.org>,
	quozl@laptop.org, Linux Input <linux-input@vger.kernel.org>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
	<devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-clk <linux-clk@vger.kernel.org>
Subject: Re: [PATCH v2 8/8] Input: olpc_apsp: allocate the GPIOs used
Date: Thu, 11 Oct 2018 10:38:20 +0200	[thread overview]
Message-ID: <CACRpkdZK3=u-E3KgVQT_Wx8tZBqO3Own_+ASLeq03vaP8q+s7A@mail.gmail.com> (raw)
In-Reply-To: <20181010142504.233467-9-lkundrak@v3.sk>

Hi Lubomir,

thanks for your patch!

On Wed, Oct 10, 2018 at 4:26 PM Lubomir Rintel <lkundrak@v3.sk> wrote:

> Take the GPIO lines are used by the SP. The driver doesn't touch the
> lines -- this is done to disallow anything else from fiddling with
> them because that would confuse the SP firmware.
>
> Also, the lines are now nicely visible in /sys/kernel/debug/gpio.
>
> Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>

Sadly I do not think this is the right way to do this these days.
In the past I would have agreed.

A few months back, Qualcomm engineers working on ACPI
support ran into similar issues: there were GPIO lines that
could not be touched by the kernel because they were used
by firmware (BIOS).

The solution we devised can be seen in
commit 726cb3ba49692bdae6caff457755e7cdb432efa4
"gpiolib: Support 'gpio-reserved-ranges' property"
which adds a "valid mask" to struct gpio_chip.

It is further refined in the lates working kernel code to make
it easy for users to set up a custom valid_mask.
https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git/commit/?h=devel&id=f8ec92a9f63b3b11e399409141b7868bb405e6b5

So what you should do is modify the platform set-up for
the OLPC to mask off these GPIO lines as invalid since
they are used by the firmware and Linux should not touch
them.

Sadly I don't know which GPIO driver the XO1 is using,
but if you tell us I bet me or Andy will be able to help you
out in finding the right spot to patch.

Yours,
Linus Walleij

  parent reply	other threads:[~2018-10-11  8:38 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-10 14:24 [PATCH v2 0/8] OLPC 1.75 Keyboard/Touchpad fixes Lubomir Rintel
2018-10-10 14:24 ` [PATCH v2 1/8] dt-bindings: olpc,ap-sp: add clock Lubomir Rintel
2018-11-04 11:41   ` Pavel Machek
2018-10-10 14:24 ` [PATCH v2 2/8] dt-bindings: olpc,ap-sp: add GPIO lines Lubomir Rintel
2018-11-04 11:49   ` Pavel Machek
2018-10-10 14:24 ` [PATCH v2 3/8] dt-bindings: marvell,mmp2: Add clock id for the SP clock Lubomir Rintel
2018-11-04 11:48   ` Pavel Machek
2018-10-10 14:25 ` [PATCH v2 4/8] clk: mmp2: add " Lubomir Rintel
2018-11-04 11:48   ` Pavel Machek
2018-10-10 14:25 ` [PATCH v2 5/8] Input: olpc_apsp: depend on CONFIG_OF Lubomir Rintel
2018-10-10 17:18   ` Dmitry Torokhov
2018-11-04 11:50   ` Pavel Machek
2018-10-10 14:25 ` [PATCH v2 6/8] Input: olpc_apsp: check FIFO status on open(), not probe() Lubomir Rintel
2018-10-10 14:25 ` [PATCH v2 7/8] Input: olpc_apsp: enable the SP clock Lubomir Rintel
2018-10-10 17:09   ` Dmitry Torokhov
2018-11-04 11:53   ` Pavel Machek
2018-10-10 14:25 ` [PATCH v2 8/8] Input: olpc_apsp: allocate the GPIOs used Lubomir Rintel
2018-10-10 17:10   ` Dmitry Torokhov
2018-10-10 17:11     ` Dmitry Torokhov
2018-10-11  8:38   ` Linus Walleij [this message]
2018-11-04 11:55   ` Pavel Machek
2018-10-15 19:56 ` [PATCH v2 0/8] OLPC 1.75 Keyboard/Touchpad fixes Pavel Machek
2018-10-16  9:44   ` Lubomir Rintel
2018-10-30 10:01     ` Pavel Machek
2018-10-30 10:26       ` Pavel Machek
2018-10-30 19:40         ` Lubomir Rintel
2018-10-31  3:37           ` James Cameron
2018-10-31 12:46             ` Pavel Machek
2018-10-31 11:54           ` Pavel Machek
2018-11-01 13:47           ` Pavel Machek
2018-10-30 23:54         ` James Cameron
2018-10-31 12:29           ` Pavel Machek

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='CACRpkdZK3=u-E3KgVQT_Wx8tZBqO3Own_+ASLeq03vaP8q+s7A@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkundrak@v3.sk \
    --cc=mark.rutland@arm.com \
    --cc=mturquette@baylibre.com \
    --cc=quozl@laptop.org \
    --cc=ricardo.ribalda@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=swboyd@chromium.org \
    /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;
as well as URLs for NNTP newsgroup(s).