Lines Matching refs:gserial
24 struct gnss_serial *gserial = gnss_get_drvdata(gdev); in gnss_serial_open() local
25 struct serdev_device *serdev = gserial->serdev; in gnss_serial_open()
32 serdev_device_set_baudrate(serdev, gserial->speed); in gnss_serial_open()
51 struct gnss_serial *gserial = gnss_get_drvdata(gdev); in gnss_serial_close() local
52 struct serdev_device *serdev = gserial->serdev; in gnss_serial_close()
62 struct gnss_serial *gserial = gnss_get_drvdata(gdev); in gnss_serial_write_raw() local
63 struct serdev_device *serdev = gserial->serdev; in gnss_serial_write_raw()
86 struct gnss_serial *gserial = serdev_device_get_drvdata(serdev); in gnss_serial_receive_buf() local
87 struct gnss_device *gdev = gserial->gdev; in gnss_serial_receive_buf()
97 static int gnss_serial_set_power(struct gnss_serial *gserial, in gnss_serial_set_power() argument
100 if (!gserial->ops || !gserial->ops->set_power) in gnss_serial_set_power()
103 return gserial->ops->set_power(gserial, state); in gnss_serial_set_power()
112 struct gnss_serial *gserial = serdev_device_get_drvdata(serdev); in gnss_serial_parse_dt() local
118 gserial->speed = speed; in gnss_serial_parse_dt()
126 struct gnss_serial *gserial; in gnss_serial_allocate() local
130 gserial = kzalloc(sizeof(*gserial) + data_size, GFP_KERNEL); in gnss_serial_allocate()
131 if (!gserial) in gnss_serial_allocate()
141 gnss_set_drvdata(gdev, gserial); in gnss_serial_allocate()
143 gserial->serdev = serdev; in gnss_serial_allocate()
144 gserial->gdev = gdev; in gnss_serial_allocate()
146 serdev_device_set_drvdata(serdev, gserial); in gnss_serial_allocate()
153 return gserial; in gnss_serial_allocate()
156 gnss_put_device(gserial->gdev); in gnss_serial_allocate()
158 kfree(gserial); in gnss_serial_allocate()
164 void gnss_serial_free(struct gnss_serial *gserial) in gnss_serial_free() argument
166 gnss_put_device(gserial->gdev); in gnss_serial_free()
167 kfree(gserial); in gnss_serial_free()
171 int gnss_serial_register(struct gnss_serial *gserial) in gnss_serial_register() argument
173 struct serdev_device *serdev = gserial->serdev; in gnss_serial_register()
179 ret = gnss_serial_set_power(gserial, GNSS_SERIAL_ACTIVE); in gnss_serial_register()
184 ret = gnss_register_device(gserial->gdev); in gnss_serial_register()
194 gnss_serial_set_power(gserial, GNSS_SERIAL_OFF); in gnss_serial_register()
200 void gnss_serial_deregister(struct gnss_serial *gserial) in gnss_serial_deregister() argument
202 struct serdev_device *serdev = gserial->serdev; in gnss_serial_deregister()
204 gnss_deregister_device(gserial->gdev); in gnss_serial_deregister()
209 gnss_serial_set_power(gserial, GNSS_SERIAL_OFF); in gnss_serial_deregister()
216 struct gnss_serial *gserial = dev_get_drvdata(dev); in gnss_serial_runtime_suspend() local
218 return gnss_serial_set_power(gserial, GNSS_SERIAL_STANDBY); in gnss_serial_runtime_suspend()
223 struct gnss_serial *gserial = dev_get_drvdata(dev); in gnss_serial_runtime_resume() local
225 return gnss_serial_set_power(gserial, GNSS_SERIAL_ACTIVE); in gnss_serial_runtime_resume()
240 struct gnss_serial *gserial = dev_get_drvdata(dev); in gnss_serial_suspend() local
250 ret = gnss_serial_set_power(gserial, GNSS_SERIAL_STANDBY); in gnss_serial_suspend()
257 struct gnss_serial *gserial = dev_get_drvdata(dev); in gnss_serial_resume() local
261 ret = gnss_serial_set_power(gserial, GNSS_SERIAL_ACTIVE); in gnss_serial_resume()