diff options
author | Antonio Borneo <borneo.antonio@gmail.com> | 2014-06-29 14:13:48 +0800 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2014-07-07 17:07:27 +0200 |
commit | beb9d007a846e661cfaa7719cab6b004b3380418 (patch) | |
tree | 9c66bb39ba807c6ccef1103e8fe862e02cc19362 /drivers/net/bonding/bond_netlink.c | |
parent | d6b92c2c373e0beefa8048c1448992cd5cda6e07 (diff) | |
download | blackbird-op-linux-beb9d007a846e661cfaa7719cab6b004b3380418.tar.gz blackbird-op-linux-beb9d007a846e661cfaa7719cab6b004b3380418.zip |
HID: cp2112: fix gpio value in gpio_direction_output
CP2112 does not offer an atomic method to set both gpio
direction and value.
Also it does not permit to set gpio value before putting
gpio in output. In fact, accordingly to Silicon Labs
AN495, Rev. 0.2, cpt. 4.4, the HID report to set gpio
values "does not affect any pins that are not configured
as outputs".
This is confirmed on evaluation board CP2112-EK.
With current driver, after execute:
echo in > /sys/class/gpio/gpio248/direction
echo low > /sys/class/gpio/gpio248/direction
gpio output is still high. Only after a following
echo low > /sys/class/gpio/gpio248/direction
gpio output gets low.
Fix driver by changing order of operations; first set
direction then set value.
The drawback of this new sequence is that we can have
a pulse on gpio pin when direction is changed from
input to output-low, but this cannot be avoided on
current CP2112.
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/net/bonding/bond_netlink.c')
0 files changed, 0 insertions, 0 deletions