Lines Matching full:pf
9 * @pf: board private structure
20 ice_gnss_do_write(struct ice_pf *pf, const unsigned char *buf, unsigned int size) in ice_gnss_do_write() argument
23 struct ice_hw *hw = &pf->hw; in ice_gnss_do_write()
72 dev_err(ice_pf_to_dev(pf), "GNSS failed to write, offset=%u, size=%u, err=%d\n", in ice_gnss_do_write()
91 struct ice_pf *pf; in ice_gnss_read() local
98 pf = gnss->back; in ice_gnss_read()
99 if (!pf || !test_bit(ICE_FLAG_GNSS, pf->flags)) in ice_gnss_read()
102 hw = &pf->hw; in ice_gnss_read()
147 count = gnss_insert_raw(pf->gnss_dev, buf, i); in ice_gnss_read()
149 dev_warn(ice_pf_to_dev(pf), in ice_gnss_read()
158 dev_dbg(ice_pf_to_dev(pf), "GNSS failed to read err=%d\n", err); in ice_gnss_read()
163 * @pf: Board private structure
171 static struct gnss_serial *ice_gnss_struct_init(struct ice_pf *pf) in ice_gnss_struct_init() argument
173 struct device *dev = ice_pf_to_dev(pf); in ice_gnss_struct_init()
181 gnss->back = pf; in ice_gnss_struct_init()
182 pf->gnss_serial = gnss; in ice_gnss_struct_init()
208 struct ice_pf *pf = gnss_get_drvdata(gdev); in ice_gnss_open() local
211 if (!pf) in ice_gnss_open()
214 if (!test_bit(ICE_FLAG_GNSS, pf->flags)) in ice_gnss_open()
217 gnss = pf->gnss_serial; in ice_gnss_open()
234 struct ice_pf *pf = gnss_get_drvdata(gdev); in ice_gnss_close() local
237 if (!pf) in ice_gnss_close()
240 gnss = pf->gnss_serial; in ice_gnss_close()
261 struct ice_pf *pf = gnss_get_drvdata(gdev); in ice_gnss_write() local
268 if (!pf) in ice_gnss_write()
271 if (!test_bit(ICE_FLAG_GNSS, pf->flags)) in ice_gnss_write()
274 gnss = pf->gnss_serial; in ice_gnss_write()
278 return ice_gnss_do_write(pf, buf, count); in ice_gnss_write()
289 * @pf: Board private structure
297 static int ice_gnss_register(struct ice_pf *pf) in ice_gnss_register() argument
302 gdev = gnss_allocate_device(ice_pf_to_dev(pf)); in ice_gnss_register()
304 dev_err(ice_pf_to_dev(pf), in ice_gnss_register()
311 gnss_set_drvdata(gdev, pf); in ice_gnss_register()
314 dev_err(ice_pf_to_dev(pf), "gnss_register_device err=%d\n", in ice_gnss_register()
318 pf->gnss_dev = gdev; in ice_gnss_register()
326 * @pf: Board private structure
331 static void ice_gnss_deregister(struct ice_pf *pf) in ice_gnss_deregister() argument
333 if (pf->gnss_dev) { in ice_gnss_deregister()
334 gnss_deregister_device(pf->gnss_dev); in ice_gnss_deregister()
335 gnss_put_device(pf->gnss_dev); in ice_gnss_deregister()
336 pf->gnss_dev = NULL; in ice_gnss_deregister()
342 * @pf: Board private structure
344 void ice_gnss_init(struct ice_pf *pf) in ice_gnss_init() argument
348 pf->gnss_serial = ice_gnss_struct_init(pf); in ice_gnss_init()
349 if (!pf->gnss_serial) in ice_gnss_init()
352 ret = ice_gnss_register(pf); in ice_gnss_init()
354 set_bit(ICE_FLAG_GNSS, pf->flags); in ice_gnss_init()
355 dev_info(ice_pf_to_dev(pf), "GNSS init successful\n"); in ice_gnss_init()
357 ice_gnss_exit(pf); in ice_gnss_init()
358 dev_err(ice_pf_to_dev(pf), "GNSS init failure\n"); in ice_gnss_init()
364 * @pf: Board private structure
366 void ice_gnss_exit(struct ice_pf *pf) in ice_gnss_exit() argument
368 ice_gnss_deregister(pf); in ice_gnss_exit()
369 clear_bit(ICE_FLAG_GNSS, pf->flags); in ice_gnss_exit()
371 if (pf->gnss_serial) { in ice_gnss_exit()
372 struct gnss_serial *gnss = pf->gnss_serial; in ice_gnss_exit()
379 pf->gnss_serial = NULL; in ice_gnss_exit()