Revision a984a69e hw/tosa.c
b/hw/tosa.c | ||
---|---|---|
18 | 18 |
#include "block.h" |
19 | 19 |
#include "boards.h" |
20 | 20 |
#include "i2c.h" |
21 |
#include "ssi.h" |
|
21 | 22 |
|
22 | 23 |
#define TOSA_RAM 0x04000000 |
23 | 24 |
#define TOSA_ROM 0x00800000 |
... | ... | |
114 | 115 |
scoop_gpio_out_set(scp1, TOSA_GPIO_TC6393XB_L3V_ON, tc6393xb_l3v_get(tmio)); |
115 | 116 |
} |
116 | 117 |
|
117 |
static uint32_t tosa_ssp_read(void *opaque)
|
|
118 |
static uint32_t tosa_ssp_tansfer(SSISlave *dev, uint32_t value)
|
|
118 | 119 |
{ |
120 |
fprintf(stderr, "TG: %d %02x\n", value >> 5, value & 0x1f); |
|
119 | 121 |
return 0; |
120 | 122 |
} |
121 | 123 |
|
122 |
static void tosa_ssp_write(void *opaque, uint32_t value)
|
|
124 |
static void tosa_ssp_init(SSISlave *dev)
|
|
123 | 125 |
{ |
124 |
fprintf(stderr, "TG: %d %02x\n", value >> 5, value & 0x1f);
|
|
126 |
/* Nothing to do. */
|
|
125 | 127 |
} |
126 | 128 |
|
127 | 129 |
typedef struct { |
... | ... | |
187 | 189 |
{ |
188 | 190 |
i2c_bus *bus = pxa2xx_i2c_bus(cpu->i2c[0]); |
189 | 191 |
i2c_create_slave(bus, "tosa_dac", DAC_BASE); |
190 |
pxa2xx_ssp_attach(cpu->ssp[1], tosa_ssp_read, |
|
191 |
tosa_ssp_write, cpu); |
|
192 |
ssi_create_slave(cpu->ssp[1], "tosa-ssp"); |
|
192 | 193 |
} |
193 | 194 |
|
194 | 195 |
|
... | ... | |
250 | 251 |
.send = tosa_dac_send |
251 | 252 |
}; |
252 | 253 |
|
254 |
static SSISlaveInfo tosa_ssp_info = { |
|
255 |
.init = tosa_ssp_init, |
|
256 |
.transfer = tosa_ssp_tansfer |
|
257 |
}; |
|
258 |
|
|
253 | 259 |
static void tosa_register_devices(void) |
254 | 260 |
{ |
255 | 261 |
i2c_register_slave("tosa_dac", sizeof(TosaDACState), &tosa_dac_info); |
262 |
ssi_register_slave("tosa-ssp", sizeof(SSISlave), &tosa_ssp_info); |
|
256 | 263 |
} |
257 | 264 |
|
258 | 265 |
device_init(tosa_register_devices) |
Also available in: Unified diff