- Apr 05, 2023
-
-
Pieter De Gendt authored
Replace all (clock_control_subsys_t *) casts with (clock_control_subsys_t) Signed-off-by:
Pieter De Gendt <pieter.degendt@basalte.be>
-
- Mar 21, 2023
-
-
Gerson Fernando Budke authored
Add support to Atmel SAM SAM4E AFEC feature. Signed-off-by:
Gerson Fernando Budke <nandojve@gmail.com>
-
Gerson Fernando Budke authored
This update Atmel SAM afec driver to use clock control driver. Signed-off-by:
Gerson Fernando Budke <nandojve@gmail.com>
-
- Oct 17, 2022
-
-
Gerard Marull-Paretas authored
Change automated searching for files using "IRQ_CONNECT()" API not including <zephyr/irq.h>. Signed-off-by:
Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
-
- May 06, 2022
-
-
Gerard Marull-Paretas authored
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>
-
- Mar 24, 2022
-
-
Gerson Fernando Budke authored
This update Atmel sam afec driver to use pinctrl driver and API. It updates all boards with new pinctrl groups format. In addition, it add overlay files to allow run samples/drivers/adc example. Signed-off-by:
Gerson Fernando Budke <nandojve@gmail.com>
-
- Jan 19, 2022
-
-
Gerard Marull-Paretas authored
Stop using redundant DEV_DATA/DEV_CFG macros and use dev->data and dev->config instead. Signed-off-by:
Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
-
- Oct 20, 2021
-
-
Maureen Helm authored
Refactors all of the ADC drivers to use a shared driver class initialization priority configuration, CONFIG_ADC_INIT_PRIORITY, to allow configuring ADC drivers separately from other devices. This is similar to other driver classes like I2C and SPI. The default is set to CONFIG_KERNEL_INIT_PRIORITY_DEVICE to preserve the existing default initialization priority for most drivers. The exceptions are lmp90xxx, mcp320x, and mcux_adc16 drivers which have dependencies on GPIO, SPI, and/or DMA drivers and must therefore initialize later than the default device priority. Signed-off-by:
Maureen Helm <maureen.helm@intel.com>
-
- Jun 14, 2021
-
-
Piotr Mienkowski authored
The macros are used to get the pin(s) of a given driver instance. Add _INST prefix to match convention used by the devicetree.h. The original macros can now be used to obtain pin(s) of an arbitrary device instance identified by the nodelabel. Signed-off-by:
Piotr Mienkowski <piotr.mienkowski@gmail.com>
-
- Apr 28, 2021
-
-
Gerard Marull-Paretas authored
device_pm_control_nop is now deprecated in favour of NULL. Signed-off-by:
Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
-
- Dec 10, 2020
-
-
Kumar Gala authored
Convert adc drivers to use new DT variants of the DEVICE APIs. DEVICE_AND_API_INIT -> DEVICE_DT_DEFINE DEVICE_GET -> DEVICE_DT_GET DEVICE_DECLARE -> DEVICE_DT_INST_DECLARE etc.. Signed-off-by:
Kumar Gala <kumar.gala@linaro.org>
-
- Sep 02, 2020
-
-
Tomasz Bursztyka authored
These are all the case that coccinelle cannot find as they are inside macro declarations. Fixed via: git grep -rlz -E "\(struct device \*" | xargs -0 sed -i 's/(struct device/(const struct device/g' Fixes #27399 Signed-off-by:
Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
-
Tomasz Bursztyka authored
The goal of this patch is to replace the 'void *' parameter by 'struct device *' if they use such variable or just 'const void *' on all relevant ISRs This will avoid not-so-nice const qualifier tweaks when device instances will be constant. Note that only the ISR passed to IRQ_CONNECT are of interest here. In order to do so, the script fix_isr.py below is necessary: from pathlib import Path import subprocess import pickle import mmap import sys import re import os cocci_template = """ @r_fix_isr_0 @ type ret_type; identifier P; identifier D; @@ -ret_type <!fn!>(void *P) +ret_type <!fn!>(const struct device *P) { ... ( const struct device *D = (const struct device *)P; | const struct device *D = P; ) ... } @r_fix_isr_1 @ type ret_type; identifier P; identifier D; @@ -ret_type <!fn!>(void *P) +ret_type <!fn!>(const struct device *P) { ... const struct device *D; ... ( D = (const struct device *)P; | D = P; ) ... } @r_fix_isr_2 @ type ret_type; identifier A; @@ -ret_type <!fn!>(void *A) +ret_type <!fn!>(const void *A) { ... } @r_fix_isr_3 @ const struct device *D; @@ -<!fn!>((void *)D); +<!fn!>(D); @r_fix_isr_4 @ type ret_type; identifier D; identifier P; @@ -ret_type <!fn!>(const struct device *P) +ret_type <!fn!>(const struct device *D) { ... ( -const struct device *D = (const struct device *)P; | -const struct device *D = P; ) ... } @r_fix_isr_5 @ type ret_type; identifier D; identifier P; @@ -ret_type <!fn!>(const struct device *P) +ret_type <!fn!>(const struct device *D) { ... -const struct device *D; ... ( -D = (const struct device *)P; | -D = P; ) ... } """ def find_isr(fn): db = [] data = None start = 0 try: with open(fn, 'r+') as f: data = str(mmap.mmap(f.fileno(), 0).read()) except Exception as e: return db while True: isr = "" irq = data.find('IRQ_CONNECT', start) while irq > -1: p = 1 arg = 1 p_o = data.find('(', irq) if p_o < 0: irq = -1 break; pos = p_o + 1 while p > 0: if data[pos] == ')': p -= 1 elif data[pos] == '(': p += 1 elif data[pos] == ',' and p == 1: arg += 1 if arg == 3: isr += data[pos] pos += 1 isr = isr.strip(',\\n\\t ') if isr not in db and len(isr) > 0: db.append(isr) start = pos break if irq < 0: break return db def patch_isr(fn, isr_list): if len(isr_list) <= 0: return for isr in isr_list: tmplt = cocci_template.replace('<!fn!>', isr) with open('/tmp/isr_fix.cocci', 'w') as f: f.write(tmplt) cmd = ['spatch', '--sp-file', '/tmp/isr_fix.cocci', '--in-place', fn] subprocess.run(cmd) def process_files(path): if path.is_file() and path.suffix in ['.h', '.c']: p = str(path.parent) + '/' + path.name isr_list = find_isr(p) patch_isr(p, isr_list) elif path.is_dir(): for p in path.iterdir(): process_files(p) if len(sys.argv) < 2: print("You need to provide a dir/file path") sys.exit(1) process_files(Path(sys.argv[1])) And is run: ./fix_isr.py <zephyr root directory> Finally, some files needed manual fixes such. Fixes #27399 Signed-off-by:
Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
-
Tomasz Bursztyka authored
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>
-
- Aug 11, 2020
-
-
Tomasz Bursztyka authored
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>
-
Tomasz Bursztyka authored
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>
-
- Jun 08, 2020
-
-
Kumar Gala authored
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>
-
- May 09, 2020
-
-
Martí Bolívar authored
Usually, we want to operate only on "available" device nodes ("available" means "status is okay and a matching binding is found"), but that's not true in all cases. Sometimes we want to operate on special nodes without matching bindings, such as those describing memory. To handle the distinction, change various additional devicetree APIs making it clear that they operate only on available device nodes, adjusting gen_defines and devicetree.h implementation details accordingly: - emit macros for all existing nodes in gen_defines.py, regardless of status or matching binding - rename DT_NUM_INST to DT_NUM_INST_STATUS_OKAY - rename DT_NODE_HAS_COMPAT to DT_NODE_HAS_COMPAT_STATUS_OKAY - rename DT_INST_FOREACH to DT_INST_FOREACH_STATUS_OKAY - rename DT_ANY_INST_ON_BUS to DT_ANY_INST_ON_BUS_STATUS_OKAY - rewrite DT_HAS_NODE_STATUS_OKAY in terms of a new DT_NODE_HAS_STATUS - resurrect DT_HAS_NODE in the form of DT_NODE_EXISTS - remove DT_COMPAT_ON_BUS as a public API - use the new default_prop_types edtlib parameter Signed-off-by:
Martí Bolívar <marti.bolivar@nordicsemi.no>
-
- May 08, 2020
-
-
Tomasz Bursztyka authored
Since struct devconfig was merged earlier into struct device, let's fix accessing config_info, name, ... attributes everywhere via: grep -rlZ 'dev->config->' | xargs -0 sed -i 's/dev->config->/dev->/g' Signed-off-by:
Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
-
- Apr 23, 2020
-
-
Kumar Gala authored
Reworked adc_sam_afec driver to utilize new DT_INST macros as part of this rework we also now get pin ctrl/mux configuration information from the device tree instead of via Kconfig and defines in soc_pinmap.h We remove defines from dts_fixup.h and soc_pinmap.h and associated Kconfig symbols that are no longer needed due to getting all that information from devicetree. Signed-off-by:
Kumar Gala <kumar.gala@linaro.org>
-
- Jun 28, 2019
-
-
Anas Nashif authored
move misc/util.h to sys/util.h and create a shim for backward-compatibility. No functional changes to the headers. A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES. Related to #16539 Signed-off-by:
Anas Nashif <anas.nashif@intel.com>
-
Anas Nashif authored
move misc/__assert.h to sys/__assert.h and create a shim for backward-compatibility. No functional changes to the headers. A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES. Related to #16539 Signed-off-by:
Anas Nashif <anas.nashif@intel.com>
-
Anas Nashif authored
move adc.h to drivers/adc.h and create a shim for backward-compatibility. No functional changes to the headers. A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES. Related to #16539 Signed-off-by:
Anas Nashif <anas.nashif@intel.com>
-
- Apr 02, 2019
-
-
Andrew Boie authored
We should not be storing the sequence pointer, as adc_read_async() returns immediately. The memory could be heap allocated, or on a call stack. Make a copy of it instead. Fixes: #15039 Signed-off-by:
Andrew Boie <andrew.p.boie@intel.com>
-
- Mar 28, 2019
-
-
Patrik Flykt authored
Add a 'U' suffix to values when computing and comparing against unsigned variables. Signed-off-by:
Patrik Flykt <patrik.flykt@intel.com>
-
- Jan 17, 2019
-
-
Andrzej Głąbek authored
Commit aad21ecb introduced an incorrect pattern of handling ADC sampling requests with invalid parameters in both nRF ADC drivers. After discarding such request, the drivers do not release properly the access lock and therefore become unusable. Unfortunately, this pattern were later on copied in all other ADC drivers in the source tree. This commit adds the proper lock releasing in all the affected drivers. Signed-off-by:
Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
-
- Dec 05, 2018
-
-
Patrik Flykt authored
Add 'U' to a value when assigning it to an unsigned variable. MISRA-C rule 7.2 Signed-off-by:
Patrik Flykt <patrik.flykt@intel.com>
-
- Nov 21, 2018
-
-
Kumar Gala authored
All of the cases of CONFIG_ADC_x_NAME should be DT_ADC_x_NAME. So go ahead and fix them up. Signed-off-by:
Kumar Gala <kumar.gala@linaro.org>
-
Kumar Gala authored
All of the cases of CONFIG_ADC_x_IRQ_PRI should be DT_ADC_x_IRQ_PRI. So go ahead and fix them up. Signed-off-by:
Kumar Gala <kumar.gala@linaro.org>
-
- Nov 13, 2018
-
-
Andrzej Głąbek authored
These changes were obtained by running a script created by Ulf Magnusson <Ulf.Magnusson@nordicsemi.no> for the following specification: 1. Read the contents of all dts_fixup.h files in Zephyr 2. Check the left-hand side of the #define macros (i.e. the X in #define X Y) 3. Check if that name is also the name of a Kconfig option 3.a If it is, then do nothing 3.b If it is not, then replace CONFIG_ with DT_ or add DT_ if it has neither of these two prefixes 4. Replace the use of the changed #define in the code itself (.c, .h, .ld) Additionally, some tweaks had to be added to this script to catch some of the macros used in the code in a parameterized form, e.g.: - CONFIG_GPIO_STM32_GPIO##__SUFFIX##_BASE_ADDRESS - CONFIG_UART_##idx##_TX_PIN - I2C_SBCON_##_num##_BASE_ADDR and to prevent adding DT_ prefix to the following symbols: - FLASH_START - FLASH_SIZE - SRAM_START - SRAM_SIZE - _ROM_ADDR - _ROM_SIZE - _RAM_ADDR - _RAM_SIZE which are surprisingly also defined in some dts_fixup.h files. Finally, some manual corrections had to be done as well: - name##_IRQ -> DT_##name##_IRQ in uart_stm32.c Signed-off-by:
Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
-
- Oct 08, 2018
-
-
Anas Nashif authored
Move to new logger subsystem. Signed-off-by:
Anas Nashif <anas.nashif@intel.com>
-
- Sep 06, 2018
-
-
Justin Watson authored
The interval_us is supported by the adc_context code. It is not a feature that the driver writer needs to code to support. Fixes bug #9723. Signed-off-by:
Justin Watson <jwatson5@gmail.com>
-
- Aug 29, 2018
-
-
Justin Watson authored
Updated to work with new ADC API. Signed-off-by:
Justin Watson <jwatson5@gmail.com>
-
- Oct 10, 2017
-
-
Jonas Pfaff authored
Tested on Atmel SMART SAM E70 Xplained board Origin: Original Jira: ZEP-2507 Signed-off-by:
Jonas Pfaff <jonas.pfaff@gmail.com>
-