From: Yang Ning <yangn.fnst@cn.fujitsu.com>
To: balrog@zabor.org
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Fwd: Max7310: confused about the method of reading output port register
Date: Sun, 01 Sep 2013 10:05:50 +0800 [thread overview]
Message-ID: <5222A0FE.1070205@cn.fujitsu.com> (raw)
Dear Zaborowski:
Firstly,I'm writing to express my thanks to you for the source
code of Max7310 which have helped me so much.
But I'm still confused about the method of reading output port register.
code:
> case 0x01: /* Output port */
> return s->level & ~s->direction;
> break;
I found some instruction of output port register in the datasheet.
>" Reads from the output port register reflect the value that is in the flip-flop
>controlling the output selection, not the actual I/O value, which may differ if
>the out-put is overloaded."
So,in my opinion,in the defination of MAX7310State,whether the property
of outputport_reg should be added?
And does the method of reading/writing output port should be modified as
follows.
[reading]
case 0x01: /* Output port */
return s->outputport_reg;
break;
[writing]
case 0x01: /* Output port */
> for (diff = (data ^ s->level) & ~s->direction; diff;
> diff &= ~(1 << line)) {
> line = ffs(diff) - 1;
> if (s->handler[line])
> qemu_set_irq(s->handler[line], (data >> line) & 1);
> }
> s->level = (s->level & s->direction) | (data & ~s->direction);
s->outputport_reg = data;
break;
reply other threads:[~2013-09-01 2:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=5222A0FE.1070205@cn.fujitsu.com \
--to=yangn.fnst@cn.fujitsu.com \
--cc=balrog@zabor.org \
--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).