Patchwork [28/48] prepare smc driver support for omap

login
register
mail settings
Submitter Riku Voipio
Date March 26, 2010, 4:06 p.m.
Message ID <c9b2b1d81555b2e38dfc606ae54fffe65799b2d3.1269617186.git.riku.voipio@nokia.com>
Download mbox | patch
Permalink /patch/48664/
State New
Headers show

Comments

Riku Voipio - March 26, 2010, 4:06 p.m.
From: Riku Voipio <riku.voipio@nokia.com>

Signed-Off-By: Riku Voipio <riku.voipio@nokia.com>
Signed-Off-By: Juha Riihimäki <juha.riihimaki@nokia.com>

---
 hw/devices.h   |    5 ++++-
 hw/smc91c111.c |   22 ++++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletions(-)

Patch

diff --git a/hw/devices.h b/hw/devices.h
index e9e8ec7..b4c10c5 100644
--- a/hw/devices.h
+++ b/hw/devices.h
@@ -5,6 +5,8 @@ 
 
 /* smc91c111.c */
 void smc91c111_init(NICInfo *, uint32_t, qemu_irq);
+void *smc91c111_init_lite(NICInfo *, qemu_irq);
+int smc91c111_iomemtype(void *opaque);
 
 /* lan9118.c */
 void lan9118_init(NICInfo *, uint32_t, qemu_irq);
@@ -21,7 +23,8 @@  void tsc210x_key_event(uWireSlave *chip, int key, int down);
 /* tsc2005.c */
 void *tsc2005_init(qemu_irq pintdav);
 uint32_t tsc2005_txrx(void *opaque, uint32_t value, int len);
-void tsc2005_set_transform(void *opaque, MouseTransformInfo *info);
+void tsc2005_set_transform(void *opaque, MouseTransformInfo *info,
+                           int z1_cons, int z2_cons);
 
 /* stellaris_input.c */
 void stellaris_gamepad_init(int n, qemu_irq *irq, const int *keycode);
diff --git a/hw/smc91c111.c b/hw/smc91c111.c
index c1a88c9..5d81d95 100644
--- a/hw/smc91c111.c
+++ b/hw/smc91c111.c
@@ -717,6 +717,7 @@  static int smc91c111_init1(SysBusDevice *dev)
     sysbus_init_irq(dev, &s->irq);
     qemu_macaddr_default_if_unset(&s->conf.macaddr);
 
+    qemu_register_reset((void *)smc91c111_reset, s);
     smc91c111_reset(s);
 
     s->nic = qemu_new_nic(&net_smc91c111_info, &s->conf,
@@ -757,4 +758,25 @@  void smc91c111_init(NICInfo *nd, uint32_t base, qemu_irq irq)
     sysbus_connect_irq(s, 0, irq);
 }
 
+void *smc91c111_init_lite(NICInfo *nd, qemu_irq irq)
+{
+    DeviceState *dev;
+    SysBusDevice *s;
+
+    qemu_check_nic_model(nd, "smc91c111");
+    dev = qdev_create(NULL, "smc91c111");
+    qdev_set_nic_properties(dev, nd);
+    qdev_init_nofail(dev);
+    s = sysbus_from_qdev(dev);
+    //sysbus_mmio_map(s, 0, base);
+    sysbus_connect_irq(s, 0, irq);
+    return s;
+}
+
+int smc91c111_iomemtype(void *opaque)
+{
+    SysBusDevice *s = (SysBusDevice *)opaque;
+    return (FROM_SYSBUS(smc91c111_state, s))->mmio_index;
+}
+
 device_init(smc91c111_register_devices)