Lines Matching +full:chip +full:- +full:id

3  * Copyright (c) 2023-2024 STMicroelectronics
6 * SPDX-License-Identifier: Apache-2.0
17 const struct lps2xdf_config *const cfg = dev->config; in ilps22qs_mode_set_odr_raw()
18 stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx; in ilps22qs_mode_set_odr_raw()
22 md.avg = cfg->avg; in ilps22qs_mode_set_odr_raw()
23 md.lpf = cfg->lpf; in ilps22qs_mode_set_odr_raw()
24 md.fs = cfg->fs; in ilps22qs_mode_set_odr_raw()
31 struct lps2xdf_data *data = dev->data; in ilps22qs_sample_fetch()
32 const struct lps2xdf_config *const cfg = dev->config; in ilps22qs_sample_fetch()
33 stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx; in ilps22qs_sample_fetch()
37 md.fs = cfg->fs; in ilps22qs_sample_fetch()
41 return -EIO; in ilps22qs_sample_fetch()
44 data->sample_press = raw_data.pressure.raw; in ilps22qs_sample_fetch()
45 data->sample_temp = raw_data.heat.raw; in ilps22qs_sample_fetch()
52 * ilps22qs_config_interrupt - not supported
56 return -ENOTSUP; in ilps22qs_config_interrupt()
60 * ilps22qs_handle_interrupt - not supported
67 * ilps22qs_trigger_set - not supported
73 return -ENOTSUP; in ilps22qs_trigger_set()
89 const struct lps2xdf_config *const cfg = dev->config; in st_ilps22qs_init()
90 stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx; in st_ilps22qs_init()
91 ilps22qs_id_t id; in st_ilps22qs_init() local
97 if (cfg->i3c.bus != NULL) { in st_ilps22qs_init()
98 struct lps2xdf_data *data = dev->data; in st_ilps22qs_init()
103 data->i3c_dev = i3c_device_find(cfg->i3c.bus, &cfg->i3c.dev_id); in st_ilps22qs_init()
104 if (data->i3c_dev == NULL) { in st_ilps22qs_init()
106 return -ENODEV; in st_ilps22qs_init()
111 if (ilps22qs_id_get(ctx, &id) < 0) { in st_ilps22qs_init()
112 LOG_ERR("%s: Not able to read dev id", dev->name); in st_ilps22qs_init()
113 return -EIO; in st_ilps22qs_init()
116 if (id.whoami != ILPS22QS_ID) { in st_ilps22qs_init()
117 LOG_ERR("%s: Invalid chip ID 0x%02x", dev->name, id.whoami); in st_ilps22qs_init()
118 return -EIO; in st_ilps22qs_init()
121 LOG_DBG("%s: chip id 0x%x", dev->name, id.whoami); in st_ilps22qs_init()
125 LOG_ERR("%s: Not able to reset device", dev->name); in st_ilps22qs_init()
126 return -EIO; in st_ilps22qs_init()
130 if (!--tries) { in st_ilps22qs_init()
132 return -ETIMEDOUT; in st_ilps22qs_init()
137 return -EIO; in st_ilps22qs_init()
143 LOG_ERR("%s: Not able to set device to ready state", dev->name); in st_ilps22qs_init()
144 return -EIO; in st_ilps22qs_init()
158 LOG_DBG("%s: odr: %d", dev->name, cfg->odr); in st_ilps22qs_init()
159 ret = ilps22qs_mode_set_odr_raw(dev, cfg->odr); in st_ilps22qs_init()
161 LOG_ERR("%s: Failed to set odr %d", dev->name, cfg->odr); in st_ilps22qs_init()
166 if (cfg->trig_enabled) { in st_ilps22qs_init()
169 return -EIO; in st_ilps22qs_init()