1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Generic serial GNSS receiver driver
5 * Copyright (C) 2018 Johan Hovold <johan@kernel.org>
8 #ifndef _LINUX_GNSS_SERIAL_H
9 #define _LINUX_GNSS_SERIAL_H
11 #include <asm/termbits.h>
15 struct serdev_device *serdev;
16 struct gnss_device *gdev;
18 const struct gnss_serial_ops *ops;
19 unsigned long drvdata[];
22 enum gnss_serial_pm_state {
28 struct gnss_serial_ops {
29 int (*set_power)(struct gnss_serial *gserial,
30 enum gnss_serial_pm_state state);
33 extern const struct dev_pm_ops gnss_serial_pm_ops;
35 struct gnss_serial *gnss_serial_allocate(struct serdev_device *gserial,
37 void gnss_serial_free(struct gnss_serial *gserial);
39 int gnss_serial_register(struct gnss_serial *gserial);
40 void gnss_serial_deregister(struct gnss_serial *gserial);
42 static inline void *gnss_serial_get_drvdata(struct gnss_serial *gserial)
44 return gserial->drvdata;
47 #endif /* _LINUX_GNSS_SERIAL_H */