From e927bb0070c9f946cfe4a276ebccfab9c5f03e0e Mon Sep 17 00:00:00 2001 From: balrog Date: Wed, 7 May 2008 14:30:38 +0000 Subject: Nokia N810 basic system emulation. Add TSC2005 touchscreen controller. Add N810 machine definition. Unify N800 and N810 ATAG list generation. Pass a word length parameter on every SPI transfer. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4374 c046a42c-6fe2-441c-8c8c-71466251a162 --- hw/tsc210x.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'hw/tsc210x.c') diff --git a/hw/tsc210x.c b/hw/tsc210x.c index da2efed..e512087 100644 --- a/hw/tsc210x.c +++ b/hw/tsc210x.c @@ -939,11 +939,15 @@ static void tsc210x_write(struct tsc210x_state_s *s, uint16_t value) } } -uint32_t tsc210x_txrx(void *opaque, uint32_t value) +uint32_t tsc210x_txrx(void *opaque, uint32_t value, int len) { struct tsc210x_state_s *s = opaque; uint32_t ret = 0; + if (len != 16) + cpu_abort(cpu_single_env, "%s: FIXME: bad SPI word width %i\n", + __FUNCTION__, len); + /* TODO: sequential reads etc - how do we make sure the host doesn't * unintentionally read out a conversion result from a register while * transmitting the command word of the next command? */ @@ -1124,12 +1128,12 @@ struct uwire_slave_s *tsc2102_init(qemu_irq pint, AudioState *audio) s->tr[0] = 0; s->tr[1] = 1; - s->tr[2] = 0; - s->tr[3] = 1; + s->tr[2] = 1; + s->tr[3] = 0; s->tr[4] = 1; s->tr[5] = 0; - s->tr[6] = 0; - s->tr[7] = 1; + s->tr[6] = 1; + s->tr[7] = 0; s->chip.opaque = s; s->chip.send = (void *) tsc210x_write; @@ -1178,12 +1182,12 @@ struct uwire_slave_s *tsc2301_init(qemu_irq penirq, qemu_irq kbirq, s->tr[0] = 0; s->tr[1] = 1; - s->tr[2] = 0; - s->tr[3] = 1; + s->tr[2] = 1; + s->tr[3] = 0; s->tr[4] = 1; s->tr[5] = 0; - s->tr[6] = 0; - s->tr[7] = 1; + s->tr[6] = 1; + s->tr[7] = 0; s->chip.opaque = s; s->chip.send = (void *) tsc210x_write; -- cgit v1.1