linux-stable/drivers
Antonio Borneo beb9d007a8 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>
2014-07-07 17:07:27 +02:00
..
accessibility
acpi This is the bulk of pin control changes for the v3.16 2014-06-03 11:20:32 -07:00
amba
ata
atm
auxdisplay
base Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial into next 2014-06-04 08:50:34 -07:00
bcma
block Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into next 2014-06-03 14:00:15 -07:00
bluetooth TTY/Serial driver patches for 3.16-rc1 2014-06-03 09:01:02 -07:00
bus ARM: SoC driver changes 2014-06-02 16:35:49 -07:00
cdrom
char Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into next 2014-06-03 14:00:15 -07:00
clk ARM: SoC driver changes 2014-06-02 16:35:49 -07:00
clocksource clocksource: versatile: Use sched_clock_register() 2014-06-04 07:46:10 -07:00
connector Char / misc driver patches for 3.16-rc1 2014-06-03 08:06:56 -07:00
cpufreq ARM: SoC driver changes 2014-06-02 16:35:49 -07:00
cpuidle Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into next 2014-06-03 14:00:15 -07:00
crypto crypto/nx/nx-842: dev_set_drvdata can no longer fail 2014-05-28 13:39:51 -07:00
dca
devfreq
dio
dma ARM: SoC driver changes 2014-06-02 16:35:49 -07:00
edac PCI changes for the v3.16 merge window: 2014-06-02 12:15:19 -07:00
eisa
extcon
firewire IEEE 1394 (FireWire) subsystem changes: 2014-06-04 07:47:03 -07:00
firmware
fmc
gpio This is the bulk of GPIO changes for the v3.16 series: 2014-06-02 08:46:03 -07:00
gpu Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial into next 2014-06-04 08:50:34 -07:00
hid HID: cp2112: fix gpio value in gpio_direction_output 2014-07-07 17:07:27 +02:00
hsi
hv hv: use correct order when freeing monitor_pages 2014-05-28 13:45:15 -07:00
hwmon New driver for NCT6683D 2014-06-03 11:09:43 -07:00
hwspinlock
i2c
ide
idle
iio Staging driver patches for 3.16-rc1 2014-06-03 08:34:00 -07:00
infiniband Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-05-23 15:29:43 -07:00
input ARM: SoC updates for 3.16 (part 1) 2014-06-02 16:15:12 -07:00
iommu Driver core / kernfs pull request for 3.16-rc1 2014-06-03 08:07:41 -07:00
ipack
irqchip ARM: SoC updates for 3.16 (part 1) 2014-06-02 16:15:12 -07:00
isdn
leds Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid into next 2014-06-04 08:52:36 -07:00
lguest
macintosh
mailbox
mcb mcb: Add support for shared PCI IRQs 2014-05-27 17:38:11 -07:00
md Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into next 2014-06-03 12:57:53 -07:00
media Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into next 2014-06-03 12:57:53 -07:00
memory
memstick
message
mfd regulator: Updates for v3.16 2014-06-03 11:44:48 -07:00
misc Merge branch 'x86-uv-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into next 2014-06-03 15:48:23 -07:00
mmc Updates for mmci driver: 2014-06-02 09:22:24 -07:00
mtd Merge branch 'for-3.16/core' of git://git.kernel.dk/linux-block into next 2014-06-02 09:29:34 -07:00
net Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial into next 2014-06-04 08:50:34 -07:00
nfc
ntb
nubus
of Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial into next 2014-06-04 08:50:34 -07:00
oprofile
parisc
parport parport: Add support for the WCH353 1S/1P multi-IO card 2014-05-28 12:30:48 -07:00
pci Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial into next 2014-06-04 08:50:34 -07:00
pcmcia pcmcia: Use pci_is_bridge() to simplify code 2014-05-27 14:58:24 -06:00
phy
pinctrl This is the bulk of pin control changes for the v3.16 2014-06-03 11:20:32 -07:00
platform Staging driver patches for 3.16-rc1 2014-06-03 08:34:00 -07:00
pnp
power regulator: Updates for v3.16 2014-06-03 11:44:48 -07:00
powercap
pps
ps3
ptp
pwm
rapidio
regulator regulator: Updates for v3.16 2014-06-03 11:44:48 -07:00
remoteproc
reset ARM: SoC driver changes 2014-06-02 16:35:49 -07:00
rpmsg
rtc
s390 At over 200 commits, covering almost all supported architectures, this 2014-06-04 08:47:12 -07:00
sbus
scsi Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial into next 2014-06-04 08:50:34 -07:00
sfi
sh
sn
soc soc: qcom: fix of_device_id table 2014-05-26 21:27:09 +02:00
spi Merge remote-tracking branch 'spi/topic/workqueue' into spi-next 2014-06-02 17:08:43 +01:00
spmi
ssb
staging Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial into next 2014-06-04 08:50:34 -07:00
target Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into next 2014-06-03 12:57:53 -07:00
tc
thermal
tty Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into next 2014-06-03 12:57:53 -07:00
uio uio: fix vma io range check in mmap 2014-05-27 14:11:06 -07:00
usb Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into next 2014-06-03 12:57:53 -07:00
uwb uwb: fix variable set but not used warnings 2014-05-27 15:18:48 -07:00
vfio driver core: dev_set_drvdata can no longer fail 2014-05-27 13:40:51 -07:00
vhost
video TTY/Serial driver patches for 3.16-rc1 2014-06-03 09:01:02 -07:00
virt
virtio
vlynq
vme
w1 Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into next 2014-06-03 12:57:53 -07:00
watchdog
xen Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into next 2014-06-03 12:57:53 -07:00
zorro
Kconfig
Makefile Char / misc driver patches for 3.16-rc1 2014-06-03 08:06:56 -07:00