• Andrey Smirnov's avatar
    serdev: Add serdev_device_write subroutine · 6fe729c4
    Andrey Smirnov authored
    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: default avatarRob Herring <robh@kernel.org>
    Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
    Signed-off-by: default avatarAndrey Smirnov <andrew.smirnov@gmail.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    6fe729c4
core.c 10.8 KB