Skip to contentSkip to conversation

hw/gpio/max7310.c : add the reset-pin in Max7310 and the GPIO will be reseted by the reset signal(active low) when necessary

PATCH Zhou Yuan 1 participant 1 message Nov 25, 2013

lore
Share & tools
lore

Zhou Yuan

author
#0 lore raw

From: Zhouy <[email protected]>
To: [email protected]
Cc: Paolo Bonzini <[email protected]>, Anthony Liguori <[email protected]>,
Andreas F?rber" <[email protected]>

Subject: Re: [Qemu-devel] [PATCH] hw/gpio/max7310.c : add the
reset-pin in Max7310 and the GPIO will be reseted by the reset
signal(active low) when necessary

Quoted 40 lines

From: zhouy <[email protected]>
Date: Sun, 17 Nov 2013 09:24:38 -0500
Subject: [PATCH 4/4] add the reset-pin in Max7310 and the GPIO will be reseted by the reset signal(active low) when necessary

---

qemu-master/hw/gpio/max7310.c | 8 ++++++--

1 files changed, 6 insertions(+), 2 deletions(-)
qemu-master/hw/gpio/max7310.c +6 -2
index 59b2877..54df220 100644
@@ -166,7 +166,11 @@ static void max7310_gpio_set(void *opaque, int line, int level)
    MAX7310State *s = (MAX7310State *) opaque;
    if (line >= ARRAY_SIZE(s->handler) || line  < 0)
        hw_error("bad GPIO line");
-
+    /* add reset-pin (active low) as the 9th gpio-in*/
+    if (line == 8 && level == 0) {
+        max7310_reset(s);
+        return;
+    }
    if (level)
        s->level |= s->direction & (1 << line);
    else
@@ -179,7 +183,7 @@ static int max7310_init(I2CSlave *i2c)
 {
    MAX7310State *s = FROM_I2C_SLAVE(MAX7310State, i2c);
 
-    qdev_init_gpio_in(&i2c->qdev, max7310_gpio_set, 8);
+    qdev_init_gpio_in(&i2c->qdev, max7310_gpio_set, 9);
    qdev_init_gpio_out(&i2c->qdev, s->handler, 8);
 
    return 0;
Signature · 1 line
1.7.6  

anyone,Ping?
thank you!
--------------
The updated address is: [email protected]
--------------------------------------------------

12:09:26