qemu-patch-raspberry4/hw/gpio
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
..
bcm2835_gpio.c bcm2835_gpio: add bcm2835 gpio controller 2017-02-28 17:10:00 +00:00
gpio_key.c hw: clean up hw/hw.h includes 2016-05-19 16:42:30 +02:00
imx_gpio.c i.MX: Fix GPIO ISR register write 2016-10-28 15:51:27 +01:00
Kconfig i2c: express dependencies with Kconfig 2019-03-07 21:45:53 +01:00
Makefile.objs hw/gpio/nrf51_gpio: Add nRF51 GPIO peripheral 2019-01-07 15:23:47 +00:00
max7310.c i2c: have I2C receive operation return uint8_t 2019-02-27 21:06:08 -06:00
mpc8xxx.c hw/gpio: QOM'ify mpc8xxx.c 2017-01-31 10:10:13 +11:00
nrf51_gpio.c nrf51_gpio: reflect pull-up/pull-down to IRQs 2019-03-25 14:16:46 +00:00
omap_gpio.c Replace all occurances of __FUNCTION__ with __func__ 2018-01-22 09:46:18 +01:00
pl061.c hw/gpio: QOM'ify pl061.c 2016-06-14 15:59:13 +01:00
puv3_gpio.c gpio/puv3_gpio: Convert sysbus init function to realize function 2018-12-13 13:47:58 +00:00
trace-events trace: enforce that every trace-events file has a final newline 2019-01-24 14:16:56 +00:00
zaurus.c hw/gpio: QOM'ify zaurus.c 2016-06-14 15:59:13 +01:00