mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Sascha Hauer" <s.hauer@pengutronix.de>
To: "Ahmad Fatoum" <a.fatoum@barebox.org>
Cc: barebox@lists.infradead.org, "Ahmad Fatoum" <a.fatoum@barebox.org>
Subject: Re: [PATCH 4/4] commands: mipi_dsi: add command for easier DCS experimentation
Date: Mon, 09 Nov 2026 09:24:59 +0000	[thread overview]
Message-ID: <7beda2a8-b1ca-427b-bc38-a63ca73284a0@pengutronix.de> (raw)
In-Reply-To: <20261108101110.1270196-4-a.fatoum@barebox.org>

On 2026-11-08 11:10, Ahmad Fatoum wrote:
> +static int do_mipi_dsi(int argc, char *argv[])
> +{
> +	struct mipi_dsi_opts opts = { .peripheral = -1 };
> +	struct mipi_dsi_device *dsi;
> +	struct device *dev;
> +	bool list = false, verbose = false, lpm = false, hs = false;
> +	unsigned long mode_flags;
> +	unsigned int channel, vc = UINT_MAX;
> +	int opt, ret;
> +
> +	dev = list_first_entry_or_null(&mipi_dsi_bus_type.device_list,
> +				       struct device, bus_list);
> +
> +	while ((opt = getopt(argc, argv, "c:d:gHilLn:p:vw")) > 0) {
> +		switch (opt) {
> +		case 'c':
> +			ret = kstrtouint(optarg, 0, &vc);
> +			if (ret)
> +				return ret;
> +			if (vc > 3)
> +				return -EINVAL;
> +			break;
> +		case 'd':
> +			dev = bus_find_device(&mipi_dsi_bus_type, NULL,
> +					      optarg, device_match_name);
> +			break;
> +		case 'g':
> +			opts.generic = true;
> +			break;
> +		case 'H':
> +			hs = true;
> +			break;
> +		case 'i':
> +			opts.info = true;
> +			break;
> +		case 'l':
> +			list = true;
> +			break;
> +		case 'L':
> +			lpm = true;
> +			break;
> +		case 'n':
> +			ret = kstrtouint(optarg, 0, &opts.len);
> +			if (ret)
> +				return ret;
> +			if (!opts.len || opts.len > MIPI_DSI_CMD_MAX_LEN)
> +				return -EINVAL;
> +			break;
> +		case 'p':
> +			if (!strcmp(optarg, "on"))
> +				opts.peripheral = 1;
> +			else if (!strcmp(optarg, "off"))
> +				opts.peripheral = 0;
> +			else
> +				return COMMAND_ERROR_USAGE;
> +			break;
> +		case 'v':
> +			verbose = true;
> +			break;
> +		case 'w':
> +			opts.write = true;
> +			break;
> +		default:
> +			return COMMAND_ERROR_USAGE;
> +		}
> +	}
> +
> +	if (list || verbose) {
> +		mipi_dsi_list(verbose);
> +		return 0;
> +	}

-v intuitively reads as "verbose", at the -v option even results in a
variable named verbose. I think it would be clearer to use -v as "Do
what you ordered to, with verbose output", rather then "list devices
verbosely"

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




      reply	other threads:[~2026-11-09  9:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-08 10:10 [PATCH 1/4] video: dw_mipi_dsi: disable the panel before powering down the host Ahmad Fatoum
2026-11-08 10:10 ` [PATCH 2/4] video: dw_mipi_dsi: refuse transfers while the host is powered down Ahmad Fatoum
2026-11-08 10:10 ` [PATCH 3/4] video: dw_mipi_dsi: give transfers in video mode a frame to complete Ahmad Fatoum
2026-11-08 10:10 ` [PATCH 4/4] commands: mipi_dsi: add command for easier DCS experimentation Ahmad Fatoum
2026-11-09  9:24   ` Sascha Hauer [this message]

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=7beda2a8-b1ca-427b-bc38-a63ca73284a0@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=a.fatoum@barebox.org \
    --cc=barebox@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