qemu/hw
Paolo Bonzini 4261b2f915 nrf51_gpio: reflect pull-up/pull-down to IRQs
Some drivers do I2C bitbanging by keeping the output to 0 and flipping
the GPIO direction between input and output (see for example in Linux
gpio_set_open_drain_value_commit, in drivers/gpio/gpiolib.c).
When the GPIO is set to input, the pull-up resistor brings the output
to 1, while when the GPIO is set to output, the output driver brings
the output to 0.

Implement this for the nRF51 GPIO device model.  First, if both input and
output are floating, and there is a pull-up or pull-down resistor
configured, do not just set s->in, but also make any devices listening
on the output qemu_irq receive that value.  Second, if the pin is
driven both internally (output pin) and externally you don't get a
short circuit if both sides drive the pin to the same value.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20190317141001.3346-1-pbonzini@redhat.com
[PMM: wrapped long line]
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-03-25 14:16:46 +00:00
..
9pfs virtio: express virtio dependencies with Kconfig 2019-03-07 21:45:53 +01:00
acpi i386, acpi: check acpi_memory_hotplug capacity in pre_plug 2019-03-12 22:31:21 -04:00
adc kconfig: introduce kconfig files 2019-03-07 21:45:53 +01:00
alpha - qtest fixes 2019-03-08 16:31:34 +00:00
arm hw/arm/virt-acpi-build: use PCIE_MMCFG_BUS to retrieve end_bus_number 2019-03-15 11:12:29 +00:00
audio audio: use qapi AudioFormat instead of audfmt_e 2019-03-11 10:29:26 +01:00
block pci, pc, virtio: features, fixes, cleanups 2019-03-13 19:10:40 +00:00
bt kconfig: introduce kconfig files 2019-03-07 21:45:53 +01:00
char spapr: Use CamelCase properly 2019-03-12 14:33:05 +11:00
core Machine queue, 2019-03-11 2019-03-12 15:25:46 +00:00
cpu kconfig: introduce kconfig files 2019-03-07 21:45:53 +01:00
cris cris-softmmu.mak: express dependencies with Kconfig 2019-03-07 21:46:19 +01:00
display virtio-gpu: clear command and fence queues on reset 2019-03-18 13:10:57 +01:00
dma isa: express dependencies with kconfig 2019-03-07 21:45:53 +01:00
gpio nrf51_gpio: reflect pull-up/pull-down to IRQs 2019-03-25 14:16:46 +00:00
hppa Update seabios-hppa to latest upstream 2019-03-15 10:11:16 -07:00
hyperv hyperv: express dependencies with kconfig 2019-03-07 21:45:53 +01:00
i2c PPC: E500: Add FSL I2C controller and integrate RTC with it 2019-03-12 14:33:04 +11:00
i386 xen-mapcache: use MAP_FIXED flag so the mmap address hint is always honored 2019-03-19 15:32:13 +00:00
ide isa: express dependencies with kconfig 2019-03-07 21:45:53 +01:00
input audio: use qapi AudioFormat instead of audfmt_e 2019-03-11 10:29:26 +01:00
intc ppc/xics/spapr: Fix H_IPOLL implementation 2019-03-19 15:20:14 +11:00
ipack build: convert pci.mak to Kconfig 2019-03-07 21:45:53 +01:00
ipmi ipmi: express dependencies with kconfig 2019-03-07 21:45:53 +01:00
isa i386, acpi: check acpi_memory_hotplug capacity in pre_plug 2019-03-12 22:31:21 -04:00
lm32 pflash: Clean up after commit 368a354f02, part 2 2019-03-11 22:53:44 +01:00
m68k m68k-softmmu.mak: express dependencies with Kconfig 2019-03-07 21:46:19 +01:00
mem ppc64: Express dependencies of 'pseries' and 'powernv' machines with kconfig 2019-03-07 21:45:53 +01:00
microblaze pflash: Clean up after commit 368a354f02, part 2 2019-03-11 22:53:44 +01:00
mips pflash: Clean up after commit 368a354f02, part 2 2019-03-11 22:53:44 +01:00
misc sparc-softmmu.mak: express dependencies with Kconfig 2019-03-07 21:46:19 +01:00
moxie moxie-softmmu.mak: express dependencies with Kconfig 2019-03-07 21:46:19 +01:00
net spapr: Use CamelCase properly 2019-03-12 14:33:05 +11:00
nios2 nios2-softmmu.mak: express dependencies with Kconfig 2019-03-07 21:46:19 +01:00
nvram fw_cfg and thunk code clean up 2019-03-12 12:29:53 +00:00
openrisc or1k-softmmu.mak: express dependencies with Kconfig 2019-03-07 21:46:19 +01:00
pci pcie: Add a simple PCIe ACS (Access Control Services) helper function 2019-03-12 22:31:21 -04:00
pci-bridge gen_pcie_root_port: Add ACS (Access Control Services) capability 2019-03-12 22:31:21 -04:00
pci-host ppc: Express dependencies of the Mac machines with kconfig 2019-03-07 21:46:19 +01:00
pcmcia kconfig: introduce kconfig files 2019-03-07 21:45:53 +01:00
ppc spapr: Remove NULL checks on error_propagate() calls 2019-03-19 15:24:15 +11:00
rdma hw/rdma: Fix the error prints in create_qp_rings() 2019-03-16 15:52:44 +02:00
riscv riscv: sifive_u: Correct UART0's IRQ in the device tree 2019-03-19 05:18:42 -07:00
s390x s390x: express dependencies with Kconfig 2019-03-07 21:46:19 +01:00
scsi vhost-user: simplify vhost_user_init/vhost_user_cleanup 2019-03-12 21:22:31 -04:00
sd hw/sd/sdhci: Move PCI-related code into a separate file 2019-03-12 07:49:04 +01:00
sh4 pflash: Clean up after commit 368a354f02, part 2 2019-03-11 22:53:44 +01:00
smbios kconfig: introduce kconfig files 2019-03-07 21:45:53 +01:00
sparc sparc-softmmu.mak: express dependencies with Kconfig 2019-03-07 21:46:19 +01:00
sparc64 sparc64-softmmu.mak: express dependencies with Kconfig 2019-03-07 21:46:19 +01:00
ssi ssi: express dependencies with kconfig 2019-03-07 21:45:53 +01:00
timer i386-softmmu.mak: remove all CONFIG_* except boards definitions 2019-03-07 21:45:53 +01:00
tpm tpm: express dependencies with Kconfig 2019-03-07 21:45:53 +01:00
tricore - qtest fixes 2019-03-08 16:31:34 +00:00
unicore32 unicore32-softmmu.mak: express dependencies with Kconfig 2019-03-07 21:46:19 +01:00
usb audio: use qapi AudioFormat instead of audfmt_e 2019-03-11 10:29:26 +01:00
vfio VFIO updates 2019-03-11 2019-03-12 13:37:29 +00:00
virtio vhost-user: Support transferring inflight buffer between qemu and backend 2019-03-12 22:31:21 -04:00
watchdog ptimer: express dependencies with Kconfig 2019-03-07 21:45:53 +01:00
xen xen: fix xen-bus state model to allow frontend re-connection 2019-02-04 11:04:49 +00:00
xenpv xen: Replace few mentions of xend by libxl 2019-01-14 13:45:40 +00:00
xtensa hw: Use PFLASH_CFI0{1,2} and TYPE_PFLASH_CFI0{1,2} 2019-03-11 22:53:44 +01:00
Kconfig ptimer: express dependencies with Kconfig 2019-03-07 21:45:53 +01:00
Makefile.objs i2c: express dependencies with Kconfig 2019-03-07 21:45:53 +01:00