From: thomas.petazzoni@free-electrons.com (Thomas Petazzoni)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] gpio: mvebu: add dbg_show function
Date: Sat, 23 Mar 2013 16:21:18 +0100 [thread overview]
Message-ID: <20130323162118.7bb6bbe3@skate> (raw)
In-Reply-To: <1363978188-31200-2-git-send-email-simon.guinot@sequanux.org>
Dear Simon Guinot,
On Fri, 22 Mar 2013 19:49:47 +0100, Simon Guinot wrote:
> + for (i = 0; i < chip->ngpio; i++) {
> + const char *label;
> + int msk;
> + bool is_out;
> +
> + label = gpiochip_is_requested(chip, i);
> + if (!label)
> + continue;
> +
> + msk = 1 << i;
> + is_out = !(io_conf & msk);
Maybe instead of using 'msk' you could use test_bit() ?
is_out = !test_bit(i, io_conf);
> + seq_printf(s, " gpio-%-3d (%-20.20s)", chip->base + i, label);
> +
> + if (is_out) {
> + seq_printf(s, " out %s %s\n",
> + out & msk ? "hi" : "lo",
test_bit(i, out) ? "hi" : "lo",
> + blink & msk ? "(blink )" : "");
test_bit(i, blink) ? "(blink )" : ""
etc.
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
next prev parent reply other threads:[~2013-03-23 15:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-22 18:49 [PATCH 0/2] Add dbg_show functions to the Marvell GPIO drivers Simon Guinot
2013-03-22 18:49 ` [PATCH 1/2] gpio: mvebu: add dbg_show function Simon Guinot
2013-03-22 19:51 ` Jason Cooper
2013-03-23 15:21 ` Thomas Petazzoni [this message]
2013-03-23 15:29 ` Simon Guinot
2013-03-23 15:43 ` Russell King - ARM Linux
2013-03-23 16:26 ` Thomas Petazzoni
2013-03-22 18:49 ` [PATCH 2/2] ARM: Orion: add dbg_show function to gpio-orion driver Simon Guinot
2013-03-30 20:44 ` Jason Cooper
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=20130323162118.7bb6bbe3@skate \
--to=thomas.petazzoni@free-electrons.com \
--cc=linux-arm-kernel@lists.infradead.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).