#include <linux/delay.h>
#include <linux/io.h>
#include <linux/scatterlist.h>
#include "common.h"
#include "pipe.h"
#define usbhsf_get_cfifo(p) …
#define usbhsf_fifo_is_busy(f) …
void usbhs_pkt_init(struct usbhs_pkt *pkt)
{ … }
static int usbhsf_null_handle(struct usbhs_pkt *pkt, int *is_done)
{ … }
static const struct usbhs_pkt_handle usbhsf_null_handler = …;
void usbhs_pkt_push(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt,
void (*done)(struct usbhs_priv *priv,
struct usbhs_pkt *pkt),
void *buf, int len, int zero, int sequence)
{ … }
static void __usbhsf_pkt_del(struct usbhs_pkt *pkt)
{ … }
struct usbhs_pkt *__usbhsf_pkt_get(struct usbhs_pipe *pipe)
{ … }
static void usbhsf_fifo_unselect(struct usbhs_pipe *pipe,
struct usbhs_fifo *fifo);
static struct dma_chan *usbhsf_dma_chan_get(struct usbhs_fifo *fifo,
struct usbhs_pkt *pkt);
#define usbhsf_dma_map(p) …
#define usbhsf_dma_unmap(p) …
static int __usbhsf_dma_map_ctrl(struct usbhs_pkt *pkt, int map);
static void usbhsf_tx_irq_ctrl(struct usbhs_pipe *pipe, int enable);
static void usbhsf_rx_irq_ctrl(struct usbhs_pipe *pipe, int enable);
struct usbhs_pkt *usbhs_pkt_pop(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt)
{ … }
enum { … };
static int usbhsf_pkt_handler(struct usbhs_pipe *pipe, int type)
{ … }
void usbhs_pkt_start(struct usbhs_pipe *pipe)
{ … }
#define usbhsf_irq_empty_ctrl(p, e) …
#define usbhsf_irq_ready_ctrl(p, e) …
#define usbhsf_irq_callback_ctrl(pipe, status, enable) …
static void usbhsf_tx_irq_ctrl(struct usbhs_pipe *pipe, int enable)
{ … }
static void usbhsf_rx_irq_ctrl(struct usbhs_pipe *pipe, int enable)
{ … }
static void usbhsf_send_terminator(struct usbhs_pipe *pipe,
struct usbhs_fifo *fifo)
{ … }
static int usbhsf_fifo_barrier(struct usbhs_priv *priv,
struct usbhs_fifo *fifo)
{ … }
static void usbhsf_fifo_clear(struct usbhs_pipe *pipe,
struct usbhs_fifo *fifo)
{ … }
static int usbhsf_fifo_rcv_len(struct usbhs_priv *priv,
struct usbhs_fifo *fifo)
{ … }
static void usbhsf_fifo_unselect(struct usbhs_pipe *pipe,
struct usbhs_fifo *fifo)
{ … }
static int usbhsf_fifo_select(struct usbhs_pipe *pipe,
struct usbhs_fifo *fifo,
int write)
{ … }
static int usbhs_dcp_dir_switch_to_write(struct usbhs_pkt *pkt, int *is_done)
{ … }
static int usbhs_dcp_dir_switch_to_read(struct usbhs_pkt *pkt, int *is_done)
{ … }
static int usbhs_dcp_dir_switch_done(struct usbhs_pkt *pkt, int *is_done)
{ … }
const struct usbhs_pkt_handle usbhs_dcp_status_stage_in_handler = …;
const struct usbhs_pkt_handle usbhs_dcp_status_stage_out_handler = …;
static int usbhsf_dcp_data_stage_try_push(struct usbhs_pkt *pkt, int *is_done)
{ … }
const struct usbhs_pkt_handle usbhs_dcp_data_stage_out_handler = …;
static int usbhsf_dcp_data_stage_prepare_pop(struct usbhs_pkt *pkt,
int *is_done)
{ … }
const struct usbhs_pkt_handle usbhs_dcp_data_stage_in_handler = …;
static int usbhsf_pio_try_push(struct usbhs_pkt *pkt, int *is_done)
{ … }
static int usbhsf_pio_prepare_push(struct usbhs_pkt *pkt, int *is_done)
{ … }
const struct usbhs_pkt_handle usbhs_fifo_pio_push_handler = …;
static int usbhsf_prepare_pop(struct usbhs_pkt *pkt, int *is_done)
{ … }
static int usbhsf_pio_try_pop(struct usbhs_pkt *pkt, int *is_done)
{ … }
const struct usbhs_pkt_handle usbhs_fifo_pio_pop_handler = …;
static int usbhsf_ctrl_stage_end(struct usbhs_pkt *pkt, int *is_done)
{ … }
const struct usbhs_pkt_handle usbhs_ctrl_stage_end_handler = …;
static struct dma_chan *usbhsf_dma_chan_get(struct usbhs_fifo *fifo,
struct usbhs_pkt *pkt)
{ … }
static struct usbhs_fifo *usbhsf_get_dma_fifo(struct usbhs_priv *priv,
struct usbhs_pkt *pkt)
{ … }
#define usbhsf_dma_start(p, f) …
#define usbhsf_dma_stop(p, f) …
static void __usbhsf_dma_ctrl(struct usbhs_pipe *pipe,
struct usbhs_fifo *fifo,
u16 dreqe)
{ … }
static int __usbhsf_dma_map_ctrl(struct usbhs_pkt *pkt, int map)
{ … }
static void usbhsf_dma_complete(void *arg,
const struct dmaengine_result *result);
static void usbhsf_dma_xfer_preparing(struct usbhs_pkt *pkt)
{ … }
static void xfer_work(struct work_struct *work)
{ … }
static int usbhsf_dma_prepare_push(struct usbhs_pkt *pkt, int *is_done)
{ … }
static int usbhsf_dma_push_done(struct usbhs_pkt *pkt, int *is_done)
{ … }
const struct usbhs_pkt_handle usbhs_fifo_dma_push_handler = …;
static int usbhsf_dma_prepare_pop_with_rx_irq(struct usbhs_pkt *pkt,
int *is_done)
{ … }
static int usbhsf_dma_prepare_pop_with_usb_dmac(struct usbhs_pkt *pkt,
int *is_done)
{ … }
static int usbhsf_dma_prepare_pop(struct usbhs_pkt *pkt, int *is_done)
{ … }
static int usbhsf_dma_try_pop_with_rx_irq(struct usbhs_pkt *pkt, int *is_done)
{ … }
static int usbhsf_dma_try_pop(struct usbhs_pkt *pkt, int *is_done)
{ … }
static int usbhsf_dma_pop_done_with_rx_irq(struct usbhs_pkt *pkt, int *is_done)
{ … }
static size_t usbhs_dma_calc_received_size(struct usbhs_pkt *pkt,
struct dma_chan *chan, int dtln)
{ … }
static int usbhsf_dma_pop_done_with_usb_dmac(struct usbhs_pkt *pkt,
int *is_done)
{ … }
static int usbhsf_dma_pop_done(struct usbhs_pkt *pkt, int *is_done)
{ … }
const struct usbhs_pkt_handle usbhs_fifo_dma_pop_handler = …;
static bool usbhsf_dma_filter(struct dma_chan *chan, void *param)
{ … }
static void usbhsf_dma_quit(struct usbhs_priv *priv, struct usbhs_fifo *fifo)
{ … }
static void usbhsf_dma_init_pdev(struct usbhs_fifo *fifo)
{ … }
static void usbhsf_dma_init_dt(struct device *dev, struct usbhs_fifo *fifo,
int channel)
{ … }
static void usbhsf_dma_init(struct usbhs_priv *priv, struct usbhs_fifo *fifo,
int channel)
{ … }
static int usbhsf_irq_empty(struct usbhs_priv *priv,
struct usbhs_irq_state *irq_state)
{ … }
static int usbhsf_irq_ready(struct usbhs_priv *priv,
struct usbhs_irq_state *irq_state)
{ … }
static void usbhsf_dma_complete(void *arg,
const struct dmaengine_result *result)
{ … }
void usbhs_fifo_clear_dcp(struct usbhs_pipe *pipe)
{ … }
void usbhs_fifo_init(struct usbhs_priv *priv)
{ … }
void usbhs_fifo_quit(struct usbhs_priv *priv)
{ … }
#define __USBHS_DFIFO_INIT(priv, fifo, channel, fifo_port) …
#define USBHS_DFIFO_INIT(priv, fifo, channel) …
#define USBHS_DFIFO_INIT_NO_PORT(priv, fifo, channel) …
int usbhs_fifo_probe(struct usbhs_priv *priv)
{ … }
void usbhs_fifo_remove(struct usbhs_priv *priv)
{ … }