field gpio hack

This commit is contained in:
espes 2015-07-05 22:58:01 +10:00
parent c2ba186cbb
commit 12f2f5f668
1 changed files with 5 additions and 2 deletions

View File

@ -33,7 +33,7 @@
#include "hw/xbox/acpi_xbox.h"
// #define DEBUG
#define DEBUG
#ifdef DEBUG
# define XBOX_DPRINTF(format, ...) printf(format, ## __VA_ARGS__)
#else
@ -43,13 +43,16 @@
#define XBOX_PM_GPIO_BASE 0xC0
#define XBOX_PM_GPIO_LEN 26
static int field_pin = 0;
static uint64_t xbox_pm_gpio_read(void *opaque, hwaddr addr, unsigned width)
{
uint64_t r = 0;
switch (addr) {
case 0:
// field pin from tv encoder?
r = 0;
field_pin = (field_pin+1)&1;
r = field_pin << 5;
break;
default:
break;