Maureen Helm
a9b223b26b
drivers: sensor: Refactor drivers to use SENSOR_DEVICE_DT_INST_DEFINE
...
Refactors all sensor drivers to use SENSOR_DEVICE_DT_INST_DEFINE, which
is a sensor-specific variant of DEVICE_DT_INST_DEFINE that provides a
common place to instantiate additional data structures for the future
sensor subsystem and/or sensor driver stats.
This approach was inspired by I2C_DEVICE_DT_INST_DEFINE to streamline
adding I2C stats support across all I2C drivers.
Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-10-27 09:27:14 +00:00
Benjamin Björnsson
b552a003b6
drivers: sensor: dps310: Add multi-instance support
...
Move driver to use DT_INST_FOREACH_STATUS_OKAY to add
multi-instance support.
Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-05 12:43:15 +02:00
Benjamin Björnsson
4edf96d40b
drivers: sensor: dps310: Update driver to use i2c_dt_spec
...
Simplify driver by using i2c_dt_spec for bus access.
Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-23 16:32:19 -05:00
Benjamin Björnsson
481fe82fa9
drivers: sensor: dps310: Change parameters of helper functions
...
Change parameter list of functions for consistency with other drivers.
Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-23 16:32:19 -05:00
Gerard Marull-Paretas
fb60aab245
drivers: migrate includes to <zephyr/...>
...
In order to bring consistency in-tree, migrate all drivers to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 19:58:21 +02:00
Nazar Kazakov
9713f0d47c
everywhere: fix typos
...
Fix a lot of typos
Signed-off-by: Nazar Kazakov <nazar.kazakov.work@gmail.com>
2022-03-14 20:22:24 -04:00
Gerard Marull-Paretas
bf7a396538
drivers: sensor: remove usage of device_pm_control_nop
...
device_pm_control_nop is now deprecated in favour of NULL.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-04-28 15:30:03 -04:00
Christoph Reiter
1b5f134477
drivers: sensor: dps310 fix out of bounds write
...
Fixes a copy-paste error which results in an out of bounds write on the
stack.
Signed-off-by: Christoph Reiter <christoph.reiter@infineon.com>
2021-02-09 10:44:43 -05:00
Kumar Gala
5f605fd5ab
drivers: sensor: Convert drivers to new DT device macros
...
Convert sensor drivers from:
DEVICE_AND_API_INIT -> DEVICE_DT_INST_DEFINE
DEVICE_GET -> DEVICE_DT_INST_GET
DEVICE_DECLARE -> DEVICE_DT_INST_DECLARE
etc..
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-16 12:19:32 -05:00
Gaspard Rigolot
2e024f5ed9
drivers: sensor: dps310 fix pressure and temperature registers
...
The two registers were inverted.
Signed-off-by: Gaspard Rigolot <gaspard.rigolot@stimio.fr>
2020-12-10 08:59:32 -06:00
Tomasz Bursztyka
e18fcbba5a
device: Const-ify all device driver instance pointers
...
Now that device_api attribute is unmodified at runtime, as well as all
the other attributes, it is possible to switch all device driver
instance to be constant.
A coccinelle rule is used for this:
@r_const_dev_1
disable optional_qualifier
@
@@
-struct device *
+const struct device *
@r_const_dev_2
disable optional_qualifier
@
@@
-struct device * const
+const struct device *
Fixes #27399
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-09-02 13:48:13 +02:00
Tomasz Bursztyka
98d9b01322
device: Apply driver_api/data attributes rename everywhere
...
Via coccinelle:
@r_device_driver_api_and_data_1@
struct device *D;
@@
(
D->
- driver_api
+ api
|
D->
- driver_data
+ data
)
@r_device_driver_api_and_data_2@
expression E;
@@
(
net_if_get_device(E)->
- driver_api
+ api
|
net_if_get_device(E)->
- driver_data
+ data
)
And grep/sed rules for macros:
git grep -rlz 'dev)->driver_data' |
xargs -0 sed -i 's/dev)->driver_data/dev)->data/g'
git grep -rlz 'dev->driver_data' |
xargs -0 sed -i 's/dev->driver_data/dev->data/g'
git grep -rlz 'device->driver_data' |
xargs -0 sed -i 's/device->driver_data/device->data/g'
Fixes #27397
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-08-11 19:30:53 +02:00
Tomasz Bursztyka
af6140cc0d
device: Apply config_info rename everywhere
...
Via coccinelle:
@r_device_config@
struct device *D;
@@
D->
- config_info
+ config
And 2 grep/sed rules for macros:
git grep -rlz 'dev)->config_info' |
xargs -0 sed -i 's/dev)->config_info/dev)->config/g'
git grep -rlz 'dev->config_info' |
xargs -0 sed -i 's/dev->config_info/dev->config/g'
Fixes #27397
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-08-11 19:30:53 +02:00
Kumar Gala
a1b77fd589
zephyr: replace zephyr integer types with C99 types
...
git grep -l 'u\(8\|16\|32\|64\)_t' | \
xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
git grep -l 's\(8\|16\|32\|64\)_t' | \
xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Christoph Reiter
d49e7da7da
sensor: add sensor driver for Infineon DPS310
...
Add driver for Infineon DPS310 temperature and pressure sensor.
Signed-off-by: Christoph Reiter <christoph.reiter@infineon.com>
2020-05-14 11:02:29 +02:00