All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][RESEND] serial_mctrl_gpio: use gpiod_set_array function
@ 2014-11-17 17:31 Rojhalat Ibrahim
  2014-11-19 22:41 ` Janusz Użycki
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Rojhalat Ibrahim @ 2014-11-17 17:31 UTC (permalink / raw)
  To: linux-gpio@vger.kernel.org, Greg Kroah-Hartman,
	linux-serial@vger.kernel.org
  Cc: Linus Walleij, Alexandre Courbot, Grant Likely, Mark Brown,
	Gerhard Sittig

Make the serial_mctrl_gpio driver the first user of the new gpiod_set_array
function, which is now available in the linux-gpio devel tree.
All modem control output signals are now set simultaneously.

Signed-off-by: Rojhalat Ibrahim <imr@rtschenk.de>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
---
Resend: Add Greg Kroah-Hartman and the linux-serial list to the recipients
        in hopes of getting an ACK.

 drivers/tty/serial/serial_mctrl_gpio.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/serial_mctrl_gpio.c b/drivers/tty/serial/serial_mctrl_gpio.c
index a3035f9..a38596c 100644
--- a/drivers/tty/serial/serial_mctrl_gpio.c
+++ b/drivers/tty/serial/serial_mctrl_gpio.c
@@ -44,15 +44,21 @@ static const struct {
 void mctrl_gpio_set(struct mctrl_gpios *gpios, unsigned int mctrl)
 {
 	enum mctrl_gpio_idx i;
+	struct gpio_desc *desc_array[UART_GPIO_MAX];
+	int value_array[UART_GPIO_MAX];
+	unsigned int count = 0;
 
 	if (IS_ERR_OR_NULL(gpios))
 		return;
 
 	for (i = 0; i < UART_GPIO_MAX; i++)
 		if (!IS_ERR_OR_NULL(gpios->gpio[i]) &&
-		    mctrl_gpios_desc[i].dir_out)
-			gpiod_set_value(gpios->gpio[i],
-					!!(mctrl & mctrl_gpios_desc[i].mctrl));
+		    mctrl_gpios_desc[i].dir_out) {
+			desc_array[count] = gpios->gpio[i];
+			value_array[count] = !!(mctrl & mctrl_gpios_desc[i].mctrl);
+			count++;
+		}
+	gpiod_set_array(count, desc_array, value_array);
 }
 EXPORT_SYMBOL_GPL(mctrl_gpio_set);
 
--
2.0.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH][RESEND] serial_mctrl_gpio: use gpiod_set_array function
  2014-11-17 17:31 [PATCH][RESEND] serial_mctrl_gpio: use gpiod_set_array function Rojhalat Ibrahim
@ 2014-11-19 22:41 ` Janusz Użycki
  2014-11-25 17:40 ` Greg Kroah-Hartman
  2014-11-28 13:52 ` Linus Walleij
  2 siblings, 0 replies; 4+ messages in thread
From: Janusz Użycki @ 2014-11-19 22:41 UTC (permalink / raw)
  To: Rojhalat Ibrahim
  Cc: Richard Genoud, linux-serial@vger.kernel.org, Greg Kroah-Hartman,
	Linus Walleij, Alexandre Courbot

Hello.

Good patch but I'd prefer to introduce separate function for mctrl_gpio.
I'm not conviced whether it is useful for 2 gpio lines (outputs: RTS, 
DTR) of mctrl_gpio.
It adds some overhead for all drivers which use mctrl_gpio but likely 
they don't require it.

best regards
Janusz

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH][RESEND] serial_mctrl_gpio: use gpiod_set_array function
  2014-11-17 17:31 [PATCH][RESEND] serial_mctrl_gpio: use gpiod_set_array function Rojhalat Ibrahim
  2014-11-19 22:41 ` Janusz Użycki
@ 2014-11-25 17:40 ` Greg Kroah-Hartman
  2014-11-28 13:52 ` Linus Walleij
  2 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2014-11-25 17:40 UTC (permalink / raw)
  To: Rojhalat Ibrahim
  Cc: linux-gpio@vger.kernel.org, linux-serial@vger.kernel.org,
	Linus Walleij, Alexandre Courbot, Grant Likely, Mark Brown,
	Gerhard Sittig

On Mon, Nov 17, 2014 at 06:31:30PM +0100, Rojhalat Ibrahim wrote:
> Make the serial_mctrl_gpio driver the first user of the new gpiod_set_array
> function, which is now available in the linux-gpio devel tree.
> All modem control output signals are now set simultaneously.
> 
> Signed-off-by: Rojhalat Ibrahim <imr@rtschenk.de>
> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
> ---
> Resend: Add Greg Kroah-Hartman and the linux-serial list to the recipients
>         in hopes of getting an ACK.
> 


Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH][RESEND] serial_mctrl_gpio: use gpiod_set_array function
  2014-11-17 17:31 [PATCH][RESEND] serial_mctrl_gpio: use gpiod_set_array function Rojhalat Ibrahim
  2014-11-19 22:41 ` Janusz Użycki
  2014-11-25 17:40 ` Greg Kroah-Hartman
@ 2014-11-28 13:52 ` Linus Walleij
  2 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2014-11-28 13:52 UTC (permalink / raw)
  To: Rojhalat Ibrahim
  Cc: linux-gpio@vger.kernel.org, Greg Kroah-Hartman,
	linux-serial@vger.kernel.org, Alexandre Courbot, Grant Likely,
	Mark Brown, Gerhard Sittig

On Mon, Nov 17, 2014 at 6:31 PM, Rojhalat Ibrahim <imr@rtschenk.de> wrote:

> Make the serial_mctrl_gpio driver the first user of the new gpiod_set_array
> function, which is now available in the linux-gpio devel tree.
> All modem control output signals are now set simultaneously.
>
> Signed-off-by: Rojhalat Ibrahim <imr@rtschenk.de>
> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>

Patch applied with Greg's ACK.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-11-28 13:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-17 17:31 [PATCH][RESEND] serial_mctrl_gpio: use gpiod_set_array function Rojhalat Ibrahim
2014-11-19 22:41 ` Janusz Użycki
2014-11-25 17:40 ` Greg Kroah-Hartman
2014-11-28 13:52 ` Linus Walleij

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.