]> Git Repo - qemu.git/blobdiff - hw/tosa.c
vga: remove unused vga_common_save/load
[qemu.git] / hw / tosa.c
index 1f87e54f09075bd9c256fe16b452515be0b9e5e9..bc6591f06614ce140a9c4c5539cdb0bc24c636cc 100644 (file)
--- 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
 static void tosa_microdrive_attach(PXA2xxState *cpu)
 {
     PCMCIACardState *md;
-    int index;
     BlockDriverState *bs;
+    DriveInfo *dinfo;
 
-    index = drive_get_index(IF_IDE, 0, 0);
-    if (index == -1)
+    dinfo = drive_get(IF_IDE, 0, 0);
+    if (!dinfo)
         return;
-    bs = drives_table[index].bdrv;
+    bs = dinfo->bdrv;
     if (bdrv_is_inserted(bs) && !bdrv_is_removable(bs)) {
-        md = dscm1xxxx_init(bs);
+        md = dscm1xxxx_init(dinfo);
         pxa2xx_pcmcia_attach(cpu->pcmcia[0], md);
     }
 }
@@ -114,14 +115,16 @@ 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 int tosa_ssp_init(SSISlave *dev)
 {
-    fprintf(stderr, "TG: %d %02x\n", value >> 5, value & 0x1f);
+    /* Nothing to do.  */
+    return 0;
 }
 
 typedef struct {
@@ -178,17 +181,17 @@ static int tosa_dac_recv(i2c_slave *s)
     return -1;
 }
 
-static void tosa_dac_init(i2c_slave *i2c)
+static int tosa_dac_init(i2c_slave *i2c)
 {
     /* Nothing to do.  */
+    return 0;
 }
 
 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");
 }
 
 
@@ -237,22 +240,39 @@ static void tosa_init(ram_addr_t ram_size,
     sl_bootparam_write(SL_PXA_PARAM_BASE);
 }
 
-QEMUMachine tosapda_machine = {
+static QEMUMachine tosapda_machine = {
     .name = "tosa",
     .desc = "Tosa PDA (PXA255)",
     .init = tosa_init,
 };
 
+static void tosapda_machine_init(void)
+{
+    qemu_register_machine(&tosapda_machine);
+}
+
+machine_init(tosapda_machine_init);
+
 static I2CSlaveInfo tosa_dac_info = {
+    .qdev.name = "tosa_dac",
+    .qdev.size = sizeof(TosaDACState),
     .init = tosa_dac_init,
     .event = tosa_dac_event,
     .recv = tosa_dac_recv,
     .send = tosa_dac_send
 };
 
+static SSISlaveInfo tosa_ssp_info = {
+    .qdev.name = "tosa-ssp",
+    .qdev.size = sizeof(SSISlave),
+    .init = tosa_ssp_init,
+    .transfer = tosa_ssp_tansfer
+};
+
 static void tosa_register_devices(void)
 {
-    i2c_register_slave("tosa_dac", sizeof(TosaDACState), &tosa_dac_info);
+    i2c_register_slave(&tosa_dac_info);
+    ssi_register_slave(&tosa_ssp_info);
 }
 
 device_init(tosa_register_devices)
This page took 0.027499 seconds and 4 git commands to generate.