Lines Matching refs:pf

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