linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 02/62] gpio: gpio-104-dio-48e: Use new GPIO_LINE_DIRECTION
       [not found] <cover.1572945605.git.matti.vaittinen@fi.rohmeurope.com>
@ 2019-11-05 10:09 ` Matti Vaittinen
  2019-11-05 15:23   ` Linus Walleij
  0 siblings, 1 reply; 4+ messages in thread
From: Matti Vaittinen @ 2019-11-05 10:09 UTC (permalink / raw)
  To: matti.vaittinen, mazziesaccount
  Cc: William Breathitt Gray, Linus Walleij, Bartosz Golaszewski,
	linux-gpio, linux-kernel

It's hard for occasional GPIO code reader/writer to know if values 0/1
equal to IN or OUT. Use defined GPIO_LINE_DIRECTION_IN and
GPIO_LINE_DIRECTION_OUT to help them out.

Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
---
 drivers/gpio/gpio-104-dio-48e.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-104-dio-48e.c b/drivers/gpio/gpio-104-dio-48e.c
index a44fa8af5b0d..400c09b905f8 100644
--- a/drivers/gpio/gpio-104-dio-48e.c
+++ b/drivers/gpio/gpio-104-dio-48e.c
@@ -59,7 +59,10 @@ static int dio48e_gpio_get_direction(struct gpio_chip *chip, unsigned offset)
 	const unsigned port = offset / 8;
 	const unsigned mask = BIT(offset % 8);
 
-	return !!(dio48egpio->io_state[port] & mask);
+	if (dio48egpio->io_state[port] & mask)
+		return  GPIO_LINE_DIRECTION_IN;
+
+	return GPIO_LINE_DIRECTION_OUT;
 }
 
 static int dio48e_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
-- 
2.21.0


-- 
Matti Vaittinen, Linux device drivers
ROHM Semiconductors, Finland SWDC
Kiviharjunlenkki 1E
90220 OULU
FINLAND

~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~
Simon says - in Latin please.
~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~
Thanks to Simon Glass for the translation =] 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 02/62] gpio: gpio-104-dio-48e: Use new GPIO_LINE_DIRECTION
  2019-11-05 10:09 ` [PATCH 02/62] gpio: gpio-104-dio-48e: Use new GPIO_LINE_DIRECTION Matti Vaittinen
@ 2019-11-05 15:23   ` Linus Walleij
  2019-11-06  6:58     ` Vaittinen, Matti
  0 siblings, 1 reply; 4+ messages in thread
From: Linus Walleij @ 2019-11-05 15:23 UTC (permalink / raw)
  To: Matti Vaittinen
  Cc: Matti Vaittinen, William Breathitt Gray, Bartosz Golaszewski,
	open list:GPIO SUBSYSTEM, linux-kernel

On Tue, Nov 5, 2019 at 11:10 AM Matti Vaittinen
<matti.vaittinen@fi.rohmeurope.com> wrote:

> It's hard for occasional GPIO code reader/writer to know if values 0/1
> equal to IN or OUT. Use defined GPIO_LINE_DIRECTION_IN and
> GPIO_LINE_DIRECTION_OUT to help them out.
>
> Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>

Please merge all of these patches 2-n into one to avoid patch bombs
and just make one technical step.

Oh the patch bomb already dropped, hehe. Anyways I want one
big patch to apply. Please make sure it applies on the GPIO tree's
"devel" branch.

Collect any ACKs and drop most from the CC else the driver
maintainers may get annoyed.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 02/62] gpio: gpio-104-dio-48e: Use new GPIO_LINE_DIRECTION
  2019-11-05 15:23   ` Linus Walleij
@ 2019-11-06  6:58     ` Vaittinen, Matti
  2019-11-07  8:15       ` Linus Walleij
  0 siblings, 1 reply; 4+ messages in thread
From: Vaittinen, Matti @ 2019-11-06  6:58 UTC (permalink / raw)
  To: linus.walleij
  Cc: mazziesaccount, linux-gpio, bgolaszewski, linux-kernel, vilhelm.gray


On Tue, 2019-11-05 at 16:23 +0100, Linus Walleij wrote:
> On Tue, Nov 5, 2019 at 11:10 AM Matti Vaittinen
> <matti.vaittinen@fi.rohmeurope.com> wrote:
> 
> > It's hard for occasional GPIO code reader/writer to know if values
> > 0/1
> > equal to IN or OUT. Use defined GPIO_LINE_DIRECTION_IN and
> > GPIO_LINE_DIRECTION_OUT to help them out.
> > 
> > Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
> 
> Please merge all of these patches 2-n into one to avoid patch bombs
> and just make one technical step.
> 
> Oh the patch bomb already dropped, hehe. 

I was slightly impatient ^_^;

I did split the patch set into this many patches so that driver
maintainers would only need to check their own driver (just few lines).
I also thought that if some driver maintainers have objections then it
is easy to drop out such patch. The "patch bomb" 

(which you referred in the other mail 
https://lore.kernel.org/lkml/CACRpkdav+Sz04WE6N5KkKMQLOtx2BZrjWrEin06yPZQ31a47hg@mail.gmail.com/
)

was really only such bomb for you and Bartosz (+GPIO/LKML mail lists) -
I did not CC all patches to everyone - driver maintainers only got the
patch adding the define(s) and a patch for their respective driver(s)
:) Unfortunately I messed up the message IDs from mail headers so the
mails for the series were not properly threaded :/

> Anyways I want one
> big patch to apply. Please make sure it applies on the GPIO tree's
> "devel" branch.

Right. I guess I can do that.

> Collect any ACKs and drop most from the CC else the driver
> maintainers may get annoyed.

My problem is that I don't know who are the driver maintainers I should
keep and who I should drop. I don't usually know who are interested in 
which changes.


> 
> Yours,
> Linus Walleij


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 02/62] gpio: gpio-104-dio-48e: Use new GPIO_LINE_DIRECTION
  2019-11-06  6:58     ` Vaittinen, Matti
@ 2019-11-07  8:15       ` Linus Walleij
  0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2019-11-07  8:15 UTC (permalink / raw)
  To: Vaittinen, Matti
  Cc: mazziesaccount, linux-gpio, bgolaszewski, linux-kernel, vilhelm.gray

On Wed, Nov 6, 2019 at 7:58 AM Vaittinen, Matti
<Matti.Vaittinen@fi.rohmeurope.com> wrote:
> On Tue, 2019-11-05 at 16:23 +0100, Linus Walleij wrote:

> > Oh the patch bomb already dropped, hehe.
>
> I was slightly impatient ^_^;

No big deal.

> > Anyways I want one
> > big patch to apply. Please make sure it applies on the GPIO tree's
> > "devel" branch.
>
> Right. I guess I can do that.

Thanks!

> > Collect any ACKs and drop most from the CC else the driver
> > maintainers may get annoyed.
>
> My problem is that I don't know who are the driver maintainers I should
> keep and who I should drop. I don't usually know who are interested in
> which changes.

The process is not perfect, just some best effort is fine, as subsystem
maintainer I do merge mechanical patches like this across all drivers
without consent of every possible stakeholder, it's impossible to
involve everyone.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-11-07  8:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <cover.1572945605.git.matti.vaittinen@fi.rohmeurope.com>
2019-11-05 10:09 ` [PATCH 02/62] gpio: gpio-104-dio-48e: Use new GPIO_LINE_DIRECTION Matti Vaittinen
2019-11-05 15:23   ` Linus Walleij
2019-11-06  6:58     ` Vaittinen, Matti
2019-11-07  8:15       ` Linus Walleij

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).