diff options
author | Paul Brook <paul@codesourcery.com> | 2009-05-14 22:35:08 +0100 |
---|---|---|
committer | Paul Brook <paul@codesourcery.com> | 2009-05-14 22:35:08 +0100 |
commit | 0077147eab09ec56d27194cc1c6135f2b39ad652 (patch) | |
tree | 8feaa461cbf1ebb52bffa51bfa7dd84975df50e1 /hw/omap_i2c.c | |
parent | 1ea96673c611cdc05ea32ac81f40d9f864e18507 (diff) | |
download | qemu-0077147eab09ec56d27194cc1c6135f2b39ad652.zip qemu-0077147eab09ec56d27194cc1c6135f2b39ad652.tar.gz qemu-0077147eab09ec56d27194cc1c6135f2b39ad652.tar.bz2 |
Remove bogus omap i2c slave code
Signed-off-by: Paul Brook <paul@codesourcery.com>
Diffstat (limited to 'hw/omap_i2c.c')
-rw-r--r-- | hw/omap_i2c.c | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/hw/omap_i2c.c b/hw/omap_i2c.c index 258730b..f98ac8d 100644 --- a/hw/omap_i2c.c +++ b/hw/omap_i2c.c @@ -24,7 +24,6 @@ struct omap_i2c_s { qemu_irq irq; qemu_irq drq[2]; - i2c_slave slave; i2c_bus *bus; uint8_t revision; @@ -55,65 +54,6 @@ static void omap_i2c_interrupts_update(struct omap_i2c_s *s) qemu_set_irq(s->drq[1], (s->stat >> 4) & 1); /* XRDY */ } -/* These are only stubs now. */ -static void omap_i2c_event(i2c_slave *i2c, enum i2c_event event) -{ - struct omap_i2c_s *s = (struct omap_i2c_s *) i2c; - - if ((~s->control >> 15) & 1) /* I2C_EN */ - return; - - switch (event) { - case I2C_START_SEND: - case I2C_START_RECV: - s->stat |= 1 << 9; /* AAS */ - break; - case I2C_FINISH: - s->stat |= 1 << 2; /* ARDY */ - break; - case I2C_NACK: - s->stat |= 1 << 1; /* NACK */ - break; - } - - omap_i2c_interrupts_update(s); -} - -static int omap_i2c_rx(i2c_slave *i2c) -{ - struct omap_i2c_s *s = (struct omap_i2c_s *) i2c; - uint8_t ret = 0; - - if ((~s->control >> 15) & 1) /* I2C_EN */ - return -1; - - if (s->txlen) - ret = s->fifo >> ((-- s->txlen) << 3) & 0xff; - else - s->stat |= 1 << 10; /* XUDF */ - s->stat |= 1 << 4; /* XRDY */ - - omap_i2c_interrupts_update(s); - return ret; -} - -static int omap_i2c_tx(i2c_slave *i2c, uint8_t data) -{ - struct omap_i2c_s *s = (struct omap_i2c_s *) i2c; - - if ((~s->control >> 15) & 1) /* I2C_EN */ - return 1; - - if (s->rxlen < 4) - s->fifo |= data << ((s->rxlen ++) << 3); - else - s->stat |= 1 << 11; /* ROVR */ - s->stat |= 1 << 3; /* RRDY */ - - omap_i2c_interrupts_update(s); - return 1; -} - static void omap_i2c_fifo_run(struct omap_i2c_s *s) { int ack = 1; @@ -406,7 +346,6 @@ static void omap_i2c_write(void *opaque, target_phys_addr_t addr, case 0x28: /* I2C_OA */ s->addr[0] = value & 0x3ff; - i2c_set_slave_address(&s->slave, value & 0x7f); break; case 0x2c: /* I2C_SA */ @@ -494,9 +433,6 @@ struct omap_i2c_s *omap_i2c_init(target_phys_addr_t base, s->irq = irq; s->drq[0] = dma[0]; s->drq[1] = dma[1]; - s->slave.event = omap_i2c_event; - s->slave.recv = omap_i2c_rx; - s->slave.send = omap_i2c_tx; s->bus = i2c_init_bus(); omap_i2c_reset(s); @@ -518,9 +454,6 @@ struct omap_i2c_s *omap2_i2c_init(struct omap_target_agent_s *ta, s->irq = irq; s->drq[0] = dma[0]; s->drq[1] = dma[1]; - s->slave.event = omap_i2c_event; - s->slave.recv = omap_i2c_rx; - s->slave.send = omap_i2c_tx; s->bus = i2c_init_bus(); omap_i2c_reset(s); |