aboutsummaryrefslogtreecommitdiff
path: root/hw/palm.c
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2007-10-29 10:59:29 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2007-10-29 10:59:29 +0000
commitb50a6563d8590675905b730d32f17fa119664e0e (patch)
tree5f10c6b911a35969f7df2dbbb9dc097f93fd65bc /hw/palm.c
parent3efda49d150def64f69a79cbd8da760ea15a79b7 (diff)
downloadqemu-b50a6563d8590675905b730d32f17fa119664e0e.zip
qemu-b50a6563d8590675905b730d32f17fa119664e0e.tar.gz
qemu-b50a6563d8590675905b730d32f17fa119664e0e.tar.bz2
Add a qemu_irq_invert() shortcut for inverting a signal.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3485 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/palm.c')
-rw-r--r--hw/palm.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/hw/palm.c b/hw/palm.c
index 0966413..a6c9f7d 100644
--- a/hw/palm.c
+++ b/hw/palm.c
@@ -76,20 +76,13 @@ static CPUWriteMemoryFunc *static_writefn[] = {
#define PALMTE_MMC2_GPIO 7
#define PALMTE_MMC3_GPIO 11
-static void palmte_pintdav(void *opaque, int line, int level)
-{
- struct omap_mpu_state_s *cpu = (struct omap_mpu_state_s *) opaque;
-
- qemu_set_irq(omap_gpio_in_get(cpu->gpio)[PALMTE_PINTDAV_GPIO],
- !level);
-}
-
static void palmte_microwire_setup(struct omap_mpu_state_s *cpu)
{
+ qemu_irq p_int = omap_gpio_in_get(cpu->gpio)[PALMTE_PINTDAV_GPIO];
+
omap_uwire_attach(
cpu->microwire,
- tsc2102_init(
- qemu_allocate_irqs(palmte_pintdav, cpu, 1)[0]),
+ tsc2102_init(qemu_irq_invert(p_int)),
0);
}
@@ -122,14 +115,6 @@ static void palmte_button_event(void *opaque, int keycode)
!(keycode & 0x80));
}
-static void palmte_mmc_cover(void *opaque, int line, int level)
-{
- struct omap_mpu_state_s *cpu = (struct omap_mpu_state_s *) opaque;
-
- qemu_set_irq(omap_mpuio_in_get(cpu->mpuio)[PALMTE_MMC_SWITCH_GPIO],
- !level);
-}
-
static void palmte_init(int ram_size, int vga_ram_size, int boot_device,
DisplayState *ds, const char **fd_filename, int snapshot,
const char *kernel_filename, const char *kernel_cmdline,
@@ -174,7 +159,8 @@ static void palmte_init(int ram_size, int vga_ram_size, int boot_device,
omap_mmc_handlers(cpu->mmc,
omap_gpio_in_get(cpu->gpio)[PALMTE_MMC_WP_GPIO],
- qemu_allocate_irqs(palmte_mmc_cover, cpu, 1)[0]);
+ qemu_irq_invert(omap_mpuio_in_get(cpu->mpuio)
+ [PALMTE_MMC_SWITCH_GPIO]));
/* Setup initial (reset) machine state */
if (nb_option_roms) {