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

1 /* ist8310.c - Driver for Isentek IST8310 Geomagnetic Sensor */
7 * SPDX-License-Identifier: Apache-2.0
18 const struct ist8310_config *cfg = dev->config; in ist8310_bus_check()
20 return cfg->bus_io->check(&cfg->bus); in ist8310_bus_check()
25 const struct ist8310_config *cfg = dev->config; in ist8310_reg_read()
27 return cfg->bus_io->read(&cfg->bus, start, buf, size); in ist8310_reg_read()
32 const struct ist8310_config *cfg = dev->config; in ist8310_reg_write()
34 return cfg->bus_io->write(&cfg->bus, reg, val); in ist8310_reg_write()
40 struct ist8310_data *drv_data = dev->data; in ist8310_sample_fetch()
45 return -EIO; in ist8310_sample_fetch()
52 return -EIO; in ist8310_sample_fetch()
54 return -EIO; in ist8310_sample_fetch()
59 return -EIO; in ist8310_sample_fetch()
62 drv_data->sample_x = (sys_le16_to_cpu(*(uint16_t *)&buff[0])); in ist8310_sample_fetch()
63 drv_data->sample_y = (sys_le16_to_cpu(*(uint16_t *)&buff[2])); in ist8310_sample_fetch()
64 drv_data->sample_z = (sys_le16_to_cpu(*(uint16_t *)&buff[4])); in ist8310_sample_fetch()
68 return -EIO; in ist8310_sample_fetch()
77 struct ist8310_data *drv_data = dev->data; in ist8310_channel_get()
81 sensor_value_from_float(val, drv_data->sample_x * (1.0f / 1320)); in ist8310_channel_get()
84 sensor_value_from_float(val, drv_data->sample_y * (1.0f / 1320)); in ist8310_channel_get()
87 sensor_value_from_float(val, drv_data->sample_z * (1.0f / 1320)); in ist8310_channel_get()
90 sensor_value_from_float(val, drv_data->sample_x * (1.0f / 1320)); in ist8310_channel_get()
91 sensor_value_from_float(val + 1, drv_data->sample_y * (1.0f / 1320)); in ist8310_channel_get()
92 sensor_value_from_float(val + 2, drv_data->sample_z * (1.0f / 1320)); in ist8310_channel_get()
95 return -EINVAL; in ist8310_channel_get()
110 /* Read chip ID (can only be read in sleep mode)*/ in ist8310_init_chip()
112 LOG_ERR("failed reading chip id"); in ist8310_init_chip()
113 return -EIO; in ist8310_init_chip()
117 LOG_ERR("failed reading chip id"); in ist8310_init_chip()
118 return -EIO; in ist8310_init_chip()
122 LOG_ERR("failed reading chip id"); in ist8310_init_chip()
123 return -EIO; in ist8310_init_chip()
127 LOG_ERR("invalid chip id 0x%x", reg); in ist8310_init_chip()
128 return -EIO; in ist8310_init_chip()
132 LOG_ERR("failed reading chip reg2"); in ist8310_init_chip()
133 return -EIO; in ist8310_init_chip()
140 return -EIO; in ist8310_init_chip()
146 LOG_ERR("failed reading chip reg3"); in ist8310_init_chip()
147 return -EIO; in ist8310_init_chip()
154 return -EIO; in ist8310_init_chip()
159 return -EIO; in ist8310_init_chip()
164 return -EIO; in ist8310_init_chip()
169 return -EIO; in ist8310_init_chip()
176 return -EIO; in ist8310_init_chip()
193 LOG_ERR("failed to initialize chip"); in ist8310_init()
194 return -EIO; in ist8310_init()
209 * Main instantiation macro, which selects the correct bus-specific