2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-29 07:34:06 +08:00
linux-next/drivers/staging/wfx
Jérôme Pouiller b0998f0c04 staging: wfx: add IRQ handling
bh_work() is in charge to schedule all HIF message from/to chip.

On normal operation, when an IRQ is received, driver can get size of
next message in control register. In order to save control register
access, when chip send a message, it also appends a copy of control
register after the message (this register is not accounted in message
length declared in message header, but must accounted in bus request).
This copy of control register is called "piggyback".

It also handles a power saving mechanism specific to WFxxx series. This
mechanism is based on a GPIO called "wakeup" GPIO. Obviously, this gpio
is not part of SPI/SDIO standard buses and must be declared
independently (this is the main reason for why SDIO mode try to get
parameters from DT).

When wakeup is enabled, host can communicate with chip only if it is
awake. To wake up chip, there are two cases:
    - host receive an IRQ from chip (chip initiate communication): host
      just have to set wakeup GPIO before reading data
    - host want to send data to chip: host set wakeup GPIO, then wait
      for an IRQ (in fact, wait for an empty message) and finally send data

bh_work() is also in charge to track usage of chip buffers. Normally
each request expect a confirmation. However, you can notice that special
"multi tx" confirmation can acknowledge multiple requests at time.

Finally, note that wfx_bh_request_rx() is not atomic (because of
control_reg_read()). So, in SPI mode, hard-irq handler only postpone all
processing to wfx_spi_request_rx().

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20190919142527.31797-8-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-04 10:43:40 +02:00
..
Documentation/devicetree/bindings/net/wireless
bh.c staging: wfx: add IRQ handling 2019-10-04 10:43:40 +02:00
bh.h staging: wfx: add IRQ handling 2019-10-04 10:43:40 +02:00
bus_sdio.c staging: wfx: add IRQ handling 2019-10-04 10:43:40 +02:00
bus_spi.c staging: wfx: add IRQ handling 2019-10-04 10:43:40 +02:00
bus.h
debug.c staging: wfx: add tracepoints for I/O access 2019-10-04 10:43:39 +02:00
fwio.c staging: wfx: load firmware 2019-10-04 10:43:39 +02:00
fwio.h staging: wfx: load firmware 2019-10-04 10:43:39 +02:00
hif_api_cmd.h staging: wfx: import HIF API headers 2019-10-04 10:43:40 +02:00
hif_api_general.h staging: wfx: import HIF API headers 2019-10-04 10:43:40 +02:00
hif_api_mib.h staging: wfx: import HIF API headers 2019-10-04 10:43:40 +02:00
hwio.c staging: wfx: add tracepoints for I/O access 2019-10-04 10:43:39 +02:00
hwio.h staging: wfx: add I/O API 2019-10-04 10:43:39 +02:00
Kconfig
main.c staging: wfx: add IRQ handling 2019-10-04 10:43:40 +02:00
main.h staging: wfx: add IRQ handling 2019-10-04 10:43:40 +02:00
Makefile staging: wfx: add IRQ handling 2019-10-04 10:43:40 +02:00
TODO
traces.h staging: wfx: add tracepoints for I/O access 2019-10-04 10:43:39 +02:00
wfx_version.h
wfx.h staging: wfx: add IRQ handling 2019-10-04 10:43:40 +02:00