6 #include <linux/kernel.h>
8 #include <linux/types.h>
9 #include <linux/module.h>
26 #define DRV_MODULE_NAME "jazz_esp"
27 #define PFX DRV_MODULE_NAME ": "
28 #define DRV_VERSION "1.000"
29 #define DRV_MODULE_RELDATE "May 19, 2007"
31 static void jazz_esp_write8(
struct esp *
esp,
u8 val,
unsigned long reg)
36 static u8 jazz_esp_read8(
struct esp *
esp,
unsigned long reg)
38 return *(
volatile u8 *)(esp->
regs + reg);
41 static dma_addr_t jazz_esp_map_single(
struct esp *esp,
void *
buf,
47 static int jazz_esp_map_sg(
struct esp *esp,
struct scatterlist *
sg,
53 static void jazz_esp_unmap_single(
struct esp *esp,
dma_addr_t addr,
59 static void jazz_esp_unmap_sg(
struct esp *esp,
struct scatterlist *
sg,
65 static int jazz_esp_irq_pending(
struct esp *esp)
72 static void jazz_esp_reset_dma(
struct esp *esp)
77 static void jazz_esp_dma_drain(
struct esp *esp)
82 static void jazz_esp_dma_invalidate(
struct esp *esp)
87 static void jazz_esp_send_dma_cmd(
struct esp *esp,
u32 addr,
u32 esp_count,
92 jazz_esp_write8(esp, (esp_count >> 0) & 0xff,
ESP_TCLOW);
93 jazz_esp_write8(esp, (esp_count >> 8) & 0xff,
ESP_TCMED);
107 static int jazz_esp_dma_error(
struct esp *esp)
118 .esp_write8 = jazz_esp_write8,
119 .esp_read8 = jazz_esp_read8,
120 .map_single = jazz_esp_map_single,
121 .map_sg = jazz_esp_map_sg,
122 .unmap_single = jazz_esp_unmap_single,
123 .unmap_sg = jazz_esp_unmap_sg,
124 .irq_pending = jazz_esp_irq_pending,
125 .reset_dma = jazz_esp_reset_dma,
126 .dma_drain = jazz_esp_dma_drain,
127 .dma_invalidate = jazz_esp_dma_invalidate,
128 .send_dma_cmd = jazz_esp_send_dma_cmd,
129 .dma_error = jazz_esp_dma_error,
147 esp = shost_priv(host);
151 esp->
ops = &jazz_esp_ops;
171 goto fail_unmap_regs;
176 goto fail_unmap_command_block;
181 esp->
cfreq = 40000000;
193 fail_unmap_command_block:
207 unsigned int irq = esp->
host->irq;
225 .probe = esp_jazz_probe,
233 static int __init jazz_esp_init(
void)
238 static void __exit jazz_esp_exit(
void)