aboutsummaryrefslogtreecommitdiffstats
path: root/hw/tosa.c
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2009-05-14 22:35:09 +0100
committerPaul Brook <paul@codesourcery.com>2009-05-14 22:35:09 +0100
commita984a69e570d7639dba3f0b4a21b5169955162e4 (patch)
tree22914d569bacc9951f69aae2fff9d60d77fe6f68 /hw/tosa.c
parent5493e33f12b75207f8b1bb993ba97e47b3d8de85 (diff)
PXA SSI qdev conversion
Signed-off-by: Paul Brook <paul@codesourcery.com>
Diffstat (limited to 'hw/tosa.c')
-rw-r--r--hw/tosa.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/hw/tosa.c b/hw/tosa.c
index 1f87e54f0..24227d83d 100644
--- a/hw/tosa.c
+++ b/hw/tosa.c
@@ -18,6 +18,7 @@
#include "block.h"
#include "boards.h"
#include "i2c.h"
+#include "ssi.h"
#define TOSA_RAM 0x04000000
#define TOSA_ROM 0x00800000
@@ -114,14 +115,15 @@ static void tosa_gpio_setup(PXA2xxState *cpu,
scoop_gpio_out_set(scp1, TOSA_GPIO_TC6393XB_L3V_ON, tc6393xb_l3v_get(tmio));
}
-static uint32_t tosa_ssp_read(void *opaque)
+static uint32_t tosa_ssp_tansfer(SSISlave *dev, uint32_t value)
{
+ fprintf(stderr, "TG: %d %02x\n", value >> 5, value & 0x1f);
return 0;
}
-static void tosa_ssp_write(void *opaque, uint32_t value)
+static void tosa_ssp_init(SSISlave *dev)
{
- fprintf(stderr, "TG: %d %02x\n", value >> 5, value & 0x1f);
+ /* Nothing to do. */
}
typedef struct {
@@ -187,8 +189,7 @@ static void tosa_tg_init(PXA2xxState *cpu)
{
i2c_bus *bus = pxa2xx_i2c_bus(cpu->i2c[0]);
i2c_create_slave(bus, "tosa_dac", DAC_BASE);
- pxa2xx_ssp_attach(cpu->ssp[1], tosa_ssp_read,
- tosa_ssp_write, cpu);
+ ssi_create_slave(cpu->ssp[1], "tosa-ssp");
}
@@ -250,9 +251,15 @@ static I2CSlaveInfo tosa_dac_info = {
.send = tosa_dac_send
};
+static SSISlaveInfo tosa_ssp_info = {
+ .init = tosa_ssp_init,
+ .transfer = tosa_ssp_tansfer
+};
+
static void tosa_register_devices(void)
{
i2c_register_slave("tosa_dac", sizeof(TosaDACState), &tosa_dac_info);
+ ssi_register_slave("tosa-ssp", sizeof(SSISlave), &tosa_ssp_info);
}
device_init(tosa_register_devices)