[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACRpkdYzXEKVzmq_wimvbeMmOqnW8okyK09V-RpzdoesmC4P7Q@mail.gmail.com>
Date: Fri, 5 Jul 2019 23:53:25 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Chris Packham <Chris.Packham@...iedtelesis.co.nz>
Cc: Ricardo Ribalda Delgado <ricardo.ribalda@...il.com>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: gpio desc flags being lost
On Wed, Jul 3, 2019 at 11:30 PM Chris Packham
<Chris.Packham@...iedtelesis.co.nz> wrote:
> The problem is caused by commit 3edfb7bd76bd1cba ("gpiolib: Show correct
> direction from the beginning"). I'll see if I can whip up a patch to fix it.
Oh. I think:
if (chip->get_direction && gpiochip_line_is_valid(chip, i))
desc->flags = !chip->get_direction(chip, i) ?
(1 << FLAG_IS_OUT) : 0;
else
desc->flags = !chip->direction_input ?
(1 << FLAG_IS_OUT) : 0;
Needs to have desc->flags |= ... &= ~
if (!chip->get_direction(chip, i))
desc->flags |= (1 << FLAG_IS_OUT);
else
desc->flags &= ~(1 << FLAG_IS_OUT);
And the same for direction_input()
Yours,
Linus Walleij
Powered by blists - more mailing lists