qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"BALATON Zoltan" <balaton@eik.bme.hu>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PULL 03/13] include/hw/qdev-core.h: Correct and clarify gpio doc comments
Date: Tue, 16 Jul 2024 20:09:30 +0200	[thread overview]
Message-ID: <20240716180941.40211-4-philmd@linaro.org> (raw)
In-Reply-To: <20240716180941.40211-1-philmd@linaro.org>

From: Peter Maydell <peter.maydell@linaro.org>

The doc comments for the functions for named GPIO inputs and
outputs had a couple of problems:
 * some copy-and-paste errors meant the qdev_connect_gpio_out_named()
   doc comment had references to input GPIOs that should be to
   output GPIOs
 * it wasn't very clear that named GPIOs are arrays and so the
   connect functions specify a single GPIO line by giving both
   the name of the array and the index within that array

Fix the copy-and-paste errors and slightly expand the text
to say that functions are connecting one line in a named GPIO
array, not a single named GPIO line.

Reported-by: BALATON Zoltan <balaton@eik.bme.hu>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240708153312.3109380-1-peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/hw/qdev-core.h | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index 5336728a23..77bfcbdf73 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -624,8 +624,9 @@ qemu_irq qdev_get_gpio_in(DeviceState *dev, int n);
  * @name: Name of the input GPIO array
  * @n: Number of the GPIO line in that array (which must be in range)
  *
- * Returns the qemu_irq corresponding to a named input GPIO line
- * (which the device has set up with qdev_init_gpio_in_named()).
+ * Returns the qemu_irq corresponding to a single input GPIO line
+ * in a named array of input GPIO lines on a device (which the device
+ * has set up with qdev_init_gpio_in_named()).
  * The @name string must correspond to an input GPIO array which exists on
  * the device, and the index @n of the GPIO line must be valid (i.e.
  * be at least 0 and less than the total number of input GPIOs in that
@@ -673,15 +674,15 @@ void qdev_connect_gpio_out(DeviceState *dev, int n, qemu_irq pin);
  *                              GPIO lines
  * @dev: Device whose GPIO to connect
  * @name: Name of the output GPIO array
- * @n: Number of the anonymous output GPIO line (which must be in range)
+ * @n: Number of the output GPIO line within that array (which must be in range)
  * @input_pin: qemu_irq to connect the output line to
  *
- * This function connects an anonymous output GPIO line on a device
- * up to an arbitrary qemu_irq, so that when the device asserts that
- * output GPIO line, the qemu_irq's callback is invoked.
+ * This function connects a single GPIO output in a named array of output
+ * GPIO lines on a device up to an arbitrary qemu_irq, so that when the
+ * device asserts that output GPIO line, the qemu_irq's callback is invoked.
  * The @name string must correspond to an output GPIO array which exists on
  * the device, and the index @n of the GPIO line must be valid (i.e.
- * be at least 0 and less than the total number of input GPIOs in that
+ * be at least 0 and less than the total number of output GPIOs in that
  * array); this function will assert() if passed an invalid name or index.
  *
  * Outbound GPIO lines can be connected to any qemu_irq, but the common
@@ -796,7 +797,7 @@ void qdev_init_gpio_out(DeviceState *dev, qemu_irq *pins, int n);
  * @dev: Device to create output GPIOs for
  * @pins: Pointer to qemu_irq or qemu_irq array for the GPIO lines
  * @name: Name to give this array of GPIO lines
- * @n: Number of GPIO lines to create
+ * @n: Number of GPIO lines to create in this array
  *
  * Like qdev_init_gpio_out(), but creates an array of GPIO output lines
  * with a name. Code using the device can then connect these GPIO lines
-- 
2.41.0



  parent reply	other threads:[~2024-07-16 18:11 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-16 18:09 [PULL 00/13] Misc HW/UI patches for 2024-07-16 Philippe Mathieu-Daudé
2024-07-16 18:09 ` [PULL 01/13] hw/core/loader: allow loading larger ROMs Philippe Mathieu-Daudé
2024-07-16 18:09 ` [PULL 02/13] hw/isa/vt82c686: Turn "intr" irq into a named gpio Philippe Mathieu-Daudé
2024-07-16 18:09 ` Philippe Mathieu-Daudé [this message]
2024-07-16 18:09 ` [PULL 04/13] loader: remove load_image_gzipped function as its not used anywhere Philippe Mathieu-Daudé
2024-07-16 18:09 ` [PULL 05/13] accel/tcg: Make cpu_exec_interrupt hook mandatory Philippe Mathieu-Daudé
2024-07-16 18:09 ` [PULL 06/13] system/cpus: Add cpu_pause() function Philippe Mathieu-Daudé
2024-07-16 18:09 ` [PULL 07/13] esp: remove transfer size check from DMA DATA IN and DATA OUT transfers Philippe Mathieu-Daudé
2024-07-16 18:09 ` [PULL 08/13] ui/cocoa: Release CGColorSpace Philippe Mathieu-Daudé
2024-07-16 18:09 ` [PULL 09/13] ui/console: Convert mouse visibility parameter into bool Philippe Mathieu-Daudé
2024-07-16 18:09 ` [PULL 10/13] ui/cocoa: Add cursor composition Philippe Mathieu-Daudé
2024-07-16 18:09 ` [PULL 11/13] ui/console: Remove dpy_cursor_define_supported() Philippe Mathieu-Daudé
2024-10-29 12:30   ` Michael Tokarev
2024-10-29 14:04     ` Phil Dennis-Jordan
2025-01-09 13:58       ` Michael Weiser
2025-01-09 14:34         ` Hank Knox
2025-03-11 10:52           ` Michael Weiser
2024-07-16 18:09 ` [PULL 12/13] vl: fix "type is NULL" in -vga help Philippe Mathieu-Daudé
2024-07-16 18:09 ` [PULL 13/13] system/physmem: use return value of ram_block_discard_require() as errno Philippe Mathieu-Daudé
2024-07-17  5:41 ` [PULL 00/13] Misc HW/UI patches for 2024-07-16 Richard Henderson

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=20240716180941.40211-4-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=balaton@eik.bme.hu \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.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).