Re: [PATCH] ARM: OMAP: Fix GPIO switch initial output state handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jani Nikula wrote:

INIT_HIGH indicates the state of the gpio, not the state of the
switch. Why not ignore the OMAP_GPIO_SWITCH_FLAG_INVERTED all together
when setting up the switch. This way, the user does not have to think
twice. :)

The INVERTED flag can't be ignored, since sw->state must be the opposite
of the GPIO if the flag is set. The only question is, should INIT_HIGH
flag refer to the GPIO or the switch.

I did think about this, and the patch is as I intended it to be, i.e.
INIT_HIGH refers to the switch. I thought this would be less confusing.
If INVERTED is set, it's inverted *everywhere* - why not also when
setting the initial value?

How about INIT_ACTIVE to reduce possible confusion? HIGH does imply an electrical level, as opposed to a more abstract activation level.

Cheers,
Juha
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux