All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] SPI: cmd_spi.c: add option to specify bus and mode
Date: Mon, 9 Aug 2010 13:05:33 -0400	[thread overview]
Message-ID: <AANLkTikD_=B7js1PadzVWiFHAb92_7Nti2L1h9kYEKC2@mail.gmail.com> (raw)
In-Reply-To: <4C602B1B.7050800@emk-elektronik.de>

On Mon, Aug 9, 2010 at 12:21 PM, Reinhard Meyer wrote:
> @@ -107,15 +119,13 @@ int do_spi (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
> ? ? ? ? ? ? ? ?return 1;
> ? ? ? ?}
>
> - ? ? ? /* FIXME: Make these parameters run-time configurable */
> - ? ? ? slave = spi_setup_slave(CONFIG_DEFAULT_SPI_BUS, device, 1000000,
> - ? ? ? ? ? ? ? ? ? ? ? CONFIG_DEFAULT_SPI_MODE);
> + ? ? ? slave = spi_setup_slave(bus, cs, 1000000, mode);
> ? ? ? ?if (!slave) {
> - ? ? ? ? ? ? ? printf("Invalid device %d, giving up.\n", device);
> + ? ? ? ? ? ? ? printf("Invalid bus %d cs %d, giving up.\n", bus, cs);

i would use the simple naming convention like so:
    printf("Invalid device %d:%d\n", bus, cs);

> ?U_BOOT_CMD(
> ? ? ? ?sspi, ? 5, ? ? ?1, ? ? ?do_spi,
> ? ? ? ?"SPI utility commands",
> - ? ? ? "<device> <bit_len> <dout> - Send <bit_len> bits from <dout> out the SPI\n"
> - ? ? ? "<device> ?- Identifies the chip select of the device\n"
> + ? ? ? "<cs> <bit_len> <dout> - Send <bit_len> bits from <dout> out the SPI\n"
> + ? ? ? "<bus>:<cs>[.<mode>] - extended form\n"
> + ? ? ? "<bus> ? ? - Identifies the SPI bus of the device\n"
> + ? ? ? "<cs> ? ? ?- Identifies the chip select of the device\n"
> + ? ? ? "<mode> ? ?- Identifies the SPI mode to use for the transfer\n"
> ? ? ? ?"<bit_len> - Number of bits to send (base 10)\n"
> ? ? ? ?"<dout> ? ?- Hexadecimal string that gets sent"

this usage string no longer makes sense.  how about:
"[<bus>:]<cs>[.<mode>] <bit_len> <dout> - Send <bit_len> bits from
<dout> out the SPI\n"
-mike

  reply	other threads:[~2010-08-09 17:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-09 16:21 [U-Boot] [PATCH] SPI: cmd_spi.c: add option to specify bus and mode Reinhard Meyer
2010-08-09 17:05 ` Mike Frysinger [this message]
2010-08-23 22:15   ` Mike Frysinger
2010-08-24  8:05     ` Reinhard Meyer
2010-08-24 21:07       ` Mike Frysinger
2010-08-24 10:53   ` Reinhard Meyer
2010-08-26  2:04     ` Mike Frysinger
2010-08-26  5:26       ` Reinhard Meyer

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='AANLkTikD_=B7js1PadzVWiFHAb92_7Nti2L1h9kYEKC2@mail.gmail.com' \
    --to=vapier@gentoo.org \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.