Lines Matching full:sources
367 static int ssam_pos_get_sources_list(struct ssam_tablet_sw *sw, struct ssam_sources_list *sources) in ssam_pos_get_sources_list() argument
381 rsp.capacity = sizeof(*sources); in ssam_pos_get_sources_list()
383 rsp.pointer = (u8 *)sources; in ssam_pos_get_sources_list()
389 /* We need at least the 'sources->count' field. */ in ssam_pos_get_sources_list()
395 /* Make sure 'sources->count' matches with the response length. */ in ssam_pos_get_sources_list()
396 if (get_unaligned_le32(&sources->count) * sizeof(__le32) + sizeof(__le32) != rsp.length) { in ssam_pos_get_sources_list()
397 dev_err(&sw->sdev->dev, "mismatch between number of sources and response size\n"); in ssam_pos_get_sources_list()
406 struct ssam_sources_list sources = {}; in ssam_pos_get_source() local
409 status = ssam_pos_get_sources_list(sw, &sources); in ssam_pos_get_source()
413 if (get_unaligned_le32(&sources.count) == 0) { in ssam_pos_get_source()
414 dev_err(&sw->sdev->dev, "no posture sources found\n"); in ssam_pos_get_source()
422 * is a device that provides multiple sources, at which point we can in ssam_pos_get_source()
425 WARN_ON(get_unaligned_le32(&sources.count) > 1); in ssam_pos_get_source()
427 *source_id = get_unaligned_le32(&sources.id[0]); in ssam_pos_get_source()