qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Zhou Yuan" <zhouyuan.fnst@cn.fujitsu.com>
To: qemu-devel <qemu-devel@nongnu.org>
Subject: [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
Date: Sun, 17 Nov 2013 10:33:15 +0800	[thread overview]
Message-ID: <201311171033135514520@cn.fujitsu.com> (raw)
In-Reply-To: 201310111738374027672@cn.fujitsu.com

From: zhouy <zhouyuan.fnst@cn.fujitsu.com>
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


Signed-off-by: zhouy <zhouyuan.fnst@cn.fujitsu.com>
---

 qemu-master/hw/gpio/max7310.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/qemu-master/hw/gpio/max7310.c b/qemu-master/hw/gpio/max7310.c
index 59b2877..54df220 100644
--- a/qemu-master/hw/gpio/max7310.c
+++ b/qemu-master/hw/gpio/max7310.c
@@ -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;
-- 
1.7.6

--------------
A new email address of FJWAN is launched from Apr.1 2007.
The updated address is: zhouyuan.fnst@cn.fujitsu.com 
--------------------------------------------------

  reply	other threads:[~2013-11-17  2:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-11  9:38 [Qemu-devel] [PATCH] hw/gpio/max7310.c : add output register property and update the outputports level when necessary Zhou Yuan
2013-11-17  2:33 ` Zhou Yuan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-11-25  4:11 [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) " Zhou Yuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201311171033135514520@cn.fujitsu.com \
    --to=zhouyuan.fnst@cn.fujitsu.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).