summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRojhalat Ibrahim <imr@rtschenk.de>2014-11-17 20:31:30 +0300
committerLinus Walleij <linus.walleij@linaro.org>2014-12-02 16:25:42 +0300
commit834296a3c66257616d14aef245dbe86111b5ef6b (patch)
tree247bbf192906a7837ddc998d4088bf1b62137d5f /drivers
parent441e002624fa7dbc65df7947d3b53ddef605cb77 (diff)
downloadlinux-834296a3c66257616d14aef245dbe86111b5ef6b.tar.xz
serial: mctrl_gpio: use gpiod_set_array function
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> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/tty/serial/serial_mctrl_gpio.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/tty/serial/serial_mctrl_gpio.c b/drivers/tty/serial/serial_mctrl_gpio.c
index a3035f997b98..a38596c5194e 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);