From a984a69e570d7639dba3f0b4a21b5169955162e4 Mon Sep 17 00:00:00 2001 From: Paul Brook Date: Thu, 14 May 2009 22:35:09 +0100 Subject: PXA SSI qdev conversion Signed-off-by: Paul Brook --- hw/tosa.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'hw/tosa.c') 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) -- cgit v1.2.3