brintos

brintos / linux-shallow public Read only

0
0
Text · 1.6 KiB · 75e567a Raw
50 lines · c
1/* SPDX-License-Identifier: GPL-2.0 */2/* Copyright (C) 2021-2022, Intel Corporation. */3 4#ifndef _ICE_GNSS_H_5#define _ICE_GNSS_H_6 7#define ICE_E810T_GNSS_I2C_BUS		0x28#define ICE_GNSS_POLL_DATA_DELAY_TIME	(HZ / 50) /* poll every 20 ms */9#define ICE_GNSS_TIMER_DELAY_TIME	(HZ / 10) /* 0.1 second per message */10#define ICE_GNSS_TTY_WRITE_BUF		25011#define ICE_MAX_I2C_DATA_SIZE		FIELD_MAX(ICE_AQC_I2C_DATA_SIZE_M)12#define ICE_MAX_I2C_WRITE_BYTES		413 14/* u-blox ZED-F9T specific definitions */15#define ICE_GNSS_UBX_I2C_BUS_ADDR	0x4216/* Data length register is big endian */17#define ICE_GNSS_UBX_DATA_LEN_H		0xFD18#define ICE_GNSS_UBX_DATA_LEN_WIDTH	219#define ICE_GNSS_UBX_EMPTY_DATA		0xFF20/* For u-blox writes are performed without address so the first byte to write is21 * passed as I2C addr parameter.22 */23#define ICE_GNSS_UBX_WRITE_BYTES	(ICE_MAX_I2C_WRITE_BYTES + 1)24 25/**26 * struct gnss_serial - data used to initialize GNSS TTY port27 * @back: back pointer to PF28 * @kworker: kwork thread for handling periodic work29 * @read_work: read_work function for handling GNSS reads30 */31struct gnss_serial {32	struct ice_pf *back;33	struct kthread_worker *kworker;34	struct kthread_delayed_work read_work;35};36 37#if IS_ENABLED(CONFIG_GNSS)38void ice_gnss_init(struct ice_pf *pf);39void ice_gnss_exit(struct ice_pf *pf);40bool ice_gnss_is_gps_present(struct ice_hw *hw);41#else42static inline void ice_gnss_init(struct ice_pf *pf) { }43static inline void ice_gnss_exit(struct ice_pf *pf) { }44static inline bool ice_gnss_is_gps_present(struct ice_hw *hw)45{46	return false;47}48#endif /* IS_ENABLED(CONFIG_GNSS) */49#endif /* _ICE_GNSS_H_ */50