summaryrefslogtreecommitdiff
path: root/include/serial.h
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@st.com>2018-05-17 14:50:44 +0200
committerTom Rini <trini@konsulko.com>2018-05-26 18:19:17 -0400
commiteae4764f1ac2f3968a5c87a17b2e894a5fe05d0b (patch)
treeac0a591564cdb0d1092f4327a56bfa1173c5ded8 /include/serial.h
parentbe1a6f775e7615f93b7d9ef3bdbcbb335dbfea6e (diff)
dm: serial: Add setparity
Implements serial setparity ops to allow uart parity change. It allows to select ODD, EVEN or NONE parity. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Diffstat (limited to 'include/serial.h')
-rw-r--r--include/serial.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/serial.h b/include/serial.h
index 384df94ed0..b9ef6d91c9 100644
--- a/include/serial.h
+++ b/include/serial.h
@@ -67,6 +67,12 @@ extern int usbtty_tstc(void);
struct udevice;
+enum serial_par {
+ SERIAL_PAR_NONE,
+ SERIAL_PAR_ODD,
+ SERIAL_PAR_EVEN
+};
+
/**
* struct struct dm_serial_ops - Driver model serial operations
*
@@ -143,6 +149,16 @@ struct dm_serial_ops {
*/
int (*loop)(struct udevice *dev, int on);
#endif
+ /**
+ * setparity() - Set up the parity
+ *
+ * Set up a new parity for this device.
+ *
+ * @dev: Device pointer
+ * @parity: parity to use
+ * @return 0 if OK, -ve on error
+ */
+ int (*setparity)(struct udevice *dev, enum serial_par parity);
};
/**