From eec0140e6cc061c46ad9abbfa2633f23d4ba8694 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 10 Jan 2018 10:14:48 +0100 Subject: usbgadget: Update command help text - Do not use BAREBOX_CMD_HELP_OPT with an empty option to extend the previous option text. It confuses the rst converter - Add a '\t' to the options to align the option help texts in the barebox command help Signed-off-by: Sascha Hauer --- commands/usbgadget.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'commands') diff --git a/commands/usbgadget.c b/commands/usbgadget.c index 507871edd2..a1744cbe13 100644 --- a/commands/usbgadget.c +++ b/commands/usbgadget.c @@ -119,13 +119,13 @@ BAREBOX_CMD_HELP_START(usbgadget) BAREBOX_CMD_HELP_TEXT("Enable / disable a USB composite gadget on the USB device interface.") BAREBOX_CMD_HELP_TEXT("") BAREBOX_CMD_HELP_TEXT("Options:") -BAREBOX_CMD_HELP_OPT ("-a", "Create CDC ACM function") -BAREBOX_CMD_HELP_OPT ("-s", "Create Generic Serial function") -BAREBOX_CMD_HELP_OPT ("-A [desc]", "Create Android Fastboot function. If 'desc' is not provided,") -BAREBOX_CMD_HELP_OPT ("", "trying to use 'global.usbgadget.fastboot_function' variable.") -BAREBOX_CMD_HELP_OPT ("-b", "include registered barebox update handlers (fastboot specific)") -BAREBOX_CMD_HELP_OPT ("-D ", "Create DFU function") -BAREBOX_CMD_HELP_OPT ("-d", "Disable the currently running gadget") +BAREBOX_CMD_HELP_OPT ("-a\t", "Create CDC ACM function") +BAREBOX_CMD_HELP_OPT ("-s\t", "Create Generic Serial function") +BAREBOX_CMD_HELP_OPT ("-A ", "Create Android Fastboot function. If 'desc' is not provided, " + "try to use 'global.usbgadget.fastboot_function' variable.") +BAREBOX_CMD_HELP_OPT ("-b\t", "include registered barebox update handlers (fastboot specific)") +BAREBOX_CMD_HELP_OPT ("-D ", "Create DFU function") +BAREBOX_CMD_HELP_OPT ("-d\t", "Disable the currently running gadget") BAREBOX_CMD_HELP_END BAREBOX_CMD_START(usbgadget) -- cgit v1.2.3 From 2f9b25f41362e99e2b31684b5c9a1a02abc1ae8b Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Fri, 19 Jan 2018 14:28:24 +0100 Subject: mci: drop unused parameter from mci_switch() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The SWITCH command has two purposes: a) switch the command set b) Write to the EXT_CSD register If the access field (bits [25:24]) in the argument are b00, we're in case a), otherwise in b). As mci_switch() always passes MMC_SWITCH_MODE_WRITE_BYTE (0b3) in the access field, only case b) is relevant here. According to the eMMC specification[1] the command set field is ignored in case b) and so the respective parameter (that is unused already now) can be dropped. [1] Embedded Multi-Media Card (e•MMC) Electrical Standard (5.1), February 2015; paragraph 6.6.1 Signed-off-by: Uwe Kleine-König Signed-off-by: Sascha Hauer --- commands/mmc_extcsd.c | 2 +- drivers/mci/mci-core.c | 16 ++++++---------- include/mci.h | 3 +-- 3 files changed, 8 insertions(+), 13 deletions(-) (limited to 'commands') diff --git a/commands/mmc_extcsd.c b/commands/mmc_extcsd.c index 7a6d39075d..acd23a466b 100644 --- a/commands/mmc_extcsd.c +++ b/commands/mmc_extcsd.c @@ -2357,7 +2357,7 @@ static void write_field(struct mci *mci, u8 *reg, u16 index, u8 value, break; } - mci_switch(mci, 0, index, value); + mci_switch(mci, index, value); out: return; diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c index 208b7666d6..c6b4e02cbc 100644 --- a/drivers/mci/mci-core.c +++ b/drivers/mci/mci-core.c @@ -396,8 +396,7 @@ int mci_send_ext_csd(struct mci *mci, char *ext_csd) * @param value FIXME * @return Transaction status (0 on success) */ -int mci_switch(struct mci *mci, unsigned set, unsigned index, - unsigned value) +int mci_switch(struct mci *mci, unsigned index, unsigned value) { struct mci_cmd cmd; @@ -471,7 +470,7 @@ static int mmc_change_freq(struct mci *mci) cardtype = mci->ext_csd[EXT_CSD_DEVICE_TYPE] & EXT_CSD_CARD_TYPE_MASK; - err = mci_switch(mci, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_HS_TIMING, 1); + err = mci_switch(mci, EXT_CSD_HS_TIMING, 1); if (err) { dev_dbg(&mci->dev, "MMC frequency changing failed: %d\n", err); @@ -1044,9 +1043,7 @@ static int mci_startup_mmc(struct mci *mci) * 4bit transfer mode. On success set the corresponding * bus width on the host. */ - err = mci_switch(mci, EXT_CSD_CMD_SET_NORMAL, - EXT_CSD_BUS_WIDTH, - ext_csd_bits[idx]); + err = mci_switch(mci, EXT_CSD_BUS_WIDTH, ext_csd_bits[idx]); if (err) { if (idx == 0) dev_warn(&mci->dev, "Changing MMC bus width failed: %d\n", err); @@ -1253,8 +1250,7 @@ static int mci_blk_part_switch(struct mci_part *part) part_config &= ~EXT_CSD_PART_CONFIG_ACC_MASK; part_config |= part->part_cfg; - ret = mci_switch(mci, EXT_CSD_CMD_SET_NORMAL, - EXT_CSD_PARTITION_CONFIG, part_config); + ret = mci_switch(mci, EXT_CSD_PARTITION_CONFIG, part_config); if (ret) return ret; @@ -1568,8 +1564,8 @@ static int mci_set_boot(struct param_d *param, void *priv) mci->ext_csd_part_config &= ~(7 << 3); mci->ext_csd_part_config |= mci->bootpart << 3; - return mci_switch(mci, EXT_CSD_CMD_SET_NORMAL, - EXT_CSD_PARTITION_CONFIG, mci->ext_csd_part_config); + return mci_switch(mci, + EXT_CSD_PARTITION_CONFIG, mci->ext_csd_part_config); } static const char *mci_boot_names[] = { diff --git a/include/mci.h b/include/mci.h index 1f6533391a..072008ef9d 100644 --- a/include/mci.h +++ b/include/mci.h @@ -478,8 +478,7 @@ void mci_of_parse(struct mci_host *host); void mci_of_parse_node(struct mci_host *host, struct device_node *np); int mci_detect_card(struct mci_host *); int mci_send_ext_csd(struct mci *mci, char *ext_csd); -int mci_switch(struct mci *mci, unsigned set, unsigned index, - unsigned value); +int mci_switch(struct mci *mci, unsigned index, unsigned value); static inline int mmc_host_is_spi(struct mci_host *host) { -- cgit v1.2.3