mirror of https://github.com/xemu-project/xemu.git
Improve tsc2005 touchscreen usability.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4401 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
1d4e547b55
commit
e62ab7a153
|
@ -134,8 +134,8 @@ static void max7310_event(i2c_slave *i2c, enum i2c_event event)
|
||||||
s->i2c_command_byte = 1;
|
s->i2c_command_byte = 1;
|
||||||
break;
|
break;
|
||||||
case I2C_FINISH:
|
case I2C_FINISH:
|
||||||
if (s->len == 1)
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
|
if (s->len == 1)
|
||||||
printf("%s: message too short (%i bytes)\n", __FUNCTION__, s->len);
|
printf("%s: message too short (%i bytes)\n", __FUNCTION__, s->len);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
18
hw/tsc2005.c
18
hw/tsc2005.c
|
@ -23,13 +23,6 @@
|
||||||
#include "hw.h"
|
#include "hw.h"
|
||||||
#include "qemu-timer.h"
|
#include "qemu-timer.h"
|
||||||
#include "console.h"
|
#include "console.h"
|
||||||
#include "omap.h"
|
|
||||||
|
|
||||||
#define TSC_DATA_REGISTERS_PAGE 0x0
|
|
||||||
#define TSC_CONTROL_REGISTERS_PAGE 0x1
|
|
||||||
#define TSC_AUDIO_REGISTERS_PAGE 0x2
|
|
||||||
|
|
||||||
#define TSC_VERBOSE
|
|
||||||
|
|
||||||
#define TSC_CUT_RESOLUTION(value, p) ((value) >> (16 - (p ? 12 : 10)))
|
#define TSC_CUT_RESOLUTION(value, p) ((value) >> (16 - (p ? 12 : 10)))
|
||||||
|
|
||||||
|
@ -115,9 +108,6 @@ static const uint16_t mode_regs[16] = {
|
||||||
#define TEMP1_VAL (1264 << 4) /* +/- 5 at 12-bit */
|
#define TEMP1_VAL (1264 << 4) /* +/- 5 at 12-bit */
|
||||||
#define TEMP2_VAL (1531 << 4) /* +/- 5 at 12-bit */
|
#define TEMP2_VAL (1531 << 4) /* +/- 5 at 12-bit */
|
||||||
|
|
||||||
#define TSC_POWEROFF_DELAY 50
|
|
||||||
#define TSC_SOFTSTEP_DELAY 50
|
|
||||||
|
|
||||||
static uint16_t tsc2005_read(struct tsc2005_state_s *s, int reg)
|
static uint16_t tsc2005_read(struct tsc2005_state_s *s, int reg)
|
||||||
{
|
{
|
||||||
uint16_t ret;
|
uint16_t ret;
|
||||||
|
@ -250,9 +240,6 @@ static void tsc2005_pin_update(struct tsc2005_state_s *s)
|
||||||
pin_state = !s->pressure;
|
pin_state = !s->pressure;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!s->enabled)
|
|
||||||
pin_state = 0;
|
|
||||||
|
|
||||||
if (pin_state != s->irq) {
|
if (pin_state != s->irq) {
|
||||||
s->irq = pin_state;
|
s->irq = pin_state;
|
||||||
qemu_set_irq(s->pint, s->irq);
|
qemu_set_irq(s->pint, s->irq);
|
||||||
|
@ -261,6 +248,8 @@ static void tsc2005_pin_update(struct tsc2005_state_s *s)
|
||||||
switch (s->nextfunction) {
|
switch (s->nextfunction) {
|
||||||
case TSC_MODE_XYZ_SCAN:
|
case TSC_MODE_XYZ_SCAN:
|
||||||
case TSC_MODE_XY_SCAN:
|
case TSC_MODE_XY_SCAN:
|
||||||
|
if (!s->host_mode && s->dav)
|
||||||
|
s->enabled = 0;
|
||||||
if (!s->pressure)
|
if (!s->pressure)
|
||||||
return;
|
return;
|
||||||
/* Fall through */
|
/* Fall through */
|
||||||
|
@ -344,6 +333,9 @@ uint8_t tsc2005_txrx_word(void *opaque, uint8_t value)
|
||||||
s->enabled = !(value & 1);
|
s->enabled = !(value & 1);
|
||||||
fprintf(stderr, "%s: touchscreen sense %sabled\n",
|
fprintf(stderr, "%s: touchscreen sense %sabled\n",
|
||||||
__FUNCTION__, s->enabled ? "en" : "dis");
|
__FUNCTION__, s->enabled ? "en" : "dis");
|
||||||
|
if (s->busy && !s->enabled)
|
||||||
|
qemu_del_timer(s->timer);
|
||||||
|
s->busy &= s->enabled;
|
||||||
}
|
}
|
||||||
tsc2005_pin_update(s);
|
tsc2005_pin_update(s);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#include "audio/audio.h"
|
#include "audio/audio.h"
|
||||||
#include "qemu-timer.h"
|
#include "qemu-timer.h"
|
||||||
#include "console.h"
|
#include "console.h"
|
||||||
#include "omap.h"
|
#include "omap.h" /* For struct i2s_codec_s and struct uwire_slave_s */
|
||||||
|
|
||||||
#define TSC_DATA_REGISTERS_PAGE 0x0
|
#define TSC_DATA_REGISTERS_PAGE 0x0
|
||||||
#define TSC_CONTROL_REGISTERS_PAGE 0x1
|
#define TSC_CONTROL_REGISTERS_PAGE 0x1
|
||||||
|
|
Loading…
Reference in New Issue