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
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
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
Kumar Gala
9872dc16b5
drivers: sensors: Convert to new DT_INST macros
...
Convert older DT_INST_ macro use the new include/devicetree.h
DT_INST macro APIs.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-03 16:42:01 -05:00
Kumar Gala
24ae1b1aa7
include: Fix use of <misc/FOO.h> -> <sys/FOO.h>
...
Fix #include <misc/FOO.h> as misc/FOO.h has been deprecated and
should be #include <sys/FOO.h>.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-12-10 08:39:37 -05:00
Iosif Macesanu
24508a777d
drivers: sensor: Add OPT3001 light sensor driver
...
Add OPT3001 light sensor driver
Signed-off-by: Iosif Macesanu <iosif@actinius.com>
2019-10-16 14:51:07 -05:00