serdev: Add serdev_device_write subroutine
authorAndrey Smirnov <andrew.smirnov@gmail.com>
Tue, 4 Apr 2017 14:22:33 +0000 (07:22 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 8 Apr 2017 16:51:00 +0000 (18:51 +0200)
commit6fe729c4bdae41b4c5a5ff21312f021a48c69399
tree46e1fef43bf9104c00638fc2e40df99226833799
parente1dc9b08051a2c2e694edf48d1e704f07c7c143c
serdev: Add serdev_device_write subroutine

Add serdev_device_write() a blocking call allowing to transfer
arbitraty amount of data (potentially exceeding amount that
serdev_device_write_buf can process in a single call)

To support that, also add serdev_device_write_wakeup().

Drivers wanting to use full extent of serdev_device_write
functionality are expected to provide serdev_device_write_wakeup() as
a sole handler of .write_wakeup event or call it as a part of driver's
custom .write_wakeup code.

Because serdev_device_write() subroutine is a superset of
serdev_device_write_buf() the patch re-impelements latter is terms of
the former. For drivers wanting to just use serdev_device_write_buf()
.write_wakeup handler is optional.

Cc: cphealy@gmail.com
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: linux-serial@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serdev/core.c
include/linux/serdev.h