drivers: adc: add adc support for Smartbond devices

Renesas Renesas SmartBond(tm) have two ADC blocks:
GPADC and SDADC.
This change adds drivers for both.
Each ADC supports only one channel setup, drivers allow
to have multiply channels in sequence. Switching
between ADC sources in done in software.

GPADC has 10 bit resolution (accuracy can be increase
with oversampling). Values up to 3.6V can be measured
on selected pins. V30 and VBAT1 can also be measured.
SDADC has 14 bit resolution and can take measurements
from 8 pins (single of differential) and VBAT.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
This commit is contained in:
Jerzy Kasenberg 2023-01-11 13:53:36 +01:00 committed by Carles Cufí
commit ce4018511f
9 changed files with 785 additions and 0 deletions

View file

@ -0,0 +1,21 @@
# Copyright (c) 2023 Renesas Electronics Corporation
# SPDX-License-Identifier: Apache-2.0
description: Renesas SmartBond(tm) ADC node
compatible: "renesas,smartbond-adc"
include: [adc-controller.yaml, pinctrl-device.yaml]
properties:
reg:
required: true
interrupts:
required: true
"#io-channel-cells":
const: 1
io-channel-cells:
- input

View file

@ -0,0 +1,31 @@
# Copyright (c) 2023 Renesas Electronics Corporation
# SPDX-License-Identifier: Apache-2.0
description: Renesas SmartBond(tm) ADC node
compatible: "renesas,smartbond-sdadc"
include: [adc-controller.yaml, pinctrl-device.yaml]
properties:
reg:
required: true
interrupts:
required: true
"#io-channel-cells":
const: 1
clock-freq:
type: int
description: |
SDADC clock frequency selector;
enum:
- 0 # 250 kHz
- 1 # 500 kHz
- 2 # 1 MHz (default)
- 3 # 2 MHz
io-channel-cells:
- input