From 31203e4ba2e7b91aabe077aa9cac9158dd480775 Mon Sep 17 00:00:00 2001 From: Xavier Ducrohet Date: Fri, 18 Mar 2011 14:18:33 -0700 Subject: Revert "Revert "Merge 29e114d2 from master."" This reverts commit 2facea6512c84af9285682909f6ac6edcd4130ab which was not supposed to merge down from tools_R10 to master since the original reverted commit was a cherry-pick from master to tools_r10 Change-Id: Ide87af693a0f3239bacaa7313b9262e6e8c46800 --- hw/goldfish_events_device.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'hw') diff --git a/hw/goldfish_events_device.c b/hw/goldfish_events_device.c index 340dc76..3072e3b 100644 --- a/hw/goldfish_events_device.c +++ b/hw/goldfish_events_device.c @@ -448,8 +448,44 @@ void events_dev_init(uint32_t base, qemu_irq irq) * EV_ABS events are sent when the touchscreen is pressed */ if (config->hw_touchScreen) { + int32_t* values; + events_set_bit (s, EV_SYN, EV_ABS ); events_set_bits(s, EV_ABS, ABS_X, ABS_Z); + /* Allocate the absinfo to report the min/max bounds for each + * absolute dimension. The array must contain 3 tuples + * of (min,max,fuzz,flat) 32-bit values. + * + * min and max are the bounds + * fuzz corresponds to the device's fuziness, we set it to 0 + * flat corresponds to the flat position for JOEYDEV devices, + * we also set it to 0. + * + * There is no need to save/restore this array in a snapshot + * since the values only depend on the hardware configuration. + */ + s->abs_info_count = 3*4; + s->abs_info = values = malloc(sizeof(uint32_t)*s->abs_info_count); + + /* ABS_X min/max/fuzz/flat */ + values[0] = 0; + values[1] = config->hw_lcd_width-1; + values[2] = 0; + values[3] = 0; + values += 4; + + /* ABS_Y */ + values[0] = 0; + values[1] = config->hw_lcd_height-1; + values[2] = 0; + values[3] = 0; + values += 4; + + /* ABS_Z */ + values[0] = 0; + values[1] = 1; + values[2] = 0; + values[3] = 0; } /* configure EV_SW array -- cgit v1.1