mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-07-01 23:53:16 -04:00
serdev: implement get/set tiocm
Add method for getting and setting tiocm. Acked-by: Pavel Machek <pavel@ucw.cz> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Sebastian Reichel <sre@kernel.org> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
parent
b3f80c8f75
commit
5659dab26f
3 changed files with 59 additions and 0 deletions
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include <linux/types.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/termios.h>
|
||||
|
||||
struct serdev_controller;
|
||||
struct serdev_device;
|
||||
|
@ -82,6 +83,8 @@ struct serdev_controller_ops {
|
|||
void (*set_flow_control)(struct serdev_controller *, bool);
|
||||
unsigned int (*set_baudrate)(struct serdev_controller *, unsigned int);
|
||||
void (*wait_until_sent)(struct serdev_controller *, long);
|
||||
int (*get_tiocm)(struct serdev_controller *);
|
||||
int (*set_tiocm)(struct serdev_controller *, unsigned int, unsigned int);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -188,6 +191,8 @@ void serdev_device_close(struct serdev_device *);
|
|||
unsigned int serdev_device_set_baudrate(struct serdev_device *, unsigned int);
|
||||
void serdev_device_set_flow_control(struct serdev_device *, bool);
|
||||
void serdev_device_wait_until_sent(struct serdev_device *, long);
|
||||
int serdev_device_get_tiocm(struct serdev_device *);
|
||||
int serdev_device_set_tiocm(struct serdev_device *, int, int);
|
||||
int serdev_device_write_buf(struct serdev_device *, const unsigned char *, size_t);
|
||||
void serdev_device_write_flush(struct serdev_device *);
|
||||
int serdev_device_write_room(struct serdev_device *);
|
||||
|
@ -226,6 +231,14 @@ static inline unsigned int serdev_device_set_baudrate(struct serdev_device *sdev
|
|||
}
|
||||
static inline void serdev_device_set_flow_control(struct serdev_device *sdev, bool enable) {}
|
||||
static inline void serdev_device_wait_until_sent(struct serdev_device *sdev, long timeout) {}
|
||||
static inline int serdev_device_get_tiocm(struct serdev_device *serdev)
|
||||
{
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
static inline int serdev_device_set_tiocm(struct serdev_device *serdev, int set, int clear)
|
||||
{
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
static inline int serdev_device_write_buf(struct serdev_device *sdev, const unsigned char *buf, size_t count)
|
||||
{
|
||||
return -ENODEV;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue