From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Frysinger Date: Mon, 9 Aug 2010 13:05:33 -0400 Subject: [U-Boot] [PATCH] SPI: cmd_spi.c: add option to specify bus and mode In-Reply-To: <4C602B1B.7050800@emk-elektronik.de> References: <4C602B1B.7050800@emk-elektronik.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.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", > - ? ? ? " - Send bits from out the SPI\n" > - ? ? ? " ?- Identifies the chip select of the device\n" > + ? ? ? " - Send bits from out the SPI\n" > + ? ? ? ":[.] - extended form\n" > + ? ? ? " ? ? - Identifies the SPI bus of the device\n" > + ? ? ? " ? ? ?- Identifies the chip select of the device\n" > + ? ? ? " ? ?- Identifies the SPI mode to use for the transfer\n" > ? ? ? ?" - Number of bits to send (base 10)\n" > ? ? ? ?" ? ?- Hexadecimal string that gets sent" this usage string no longer makes sense. how about: "[:][.] - Send bits from out the SPI\n" -mike