Commit ae549a72 authored by David Wu's avatar David Wu Committed by Jonathan Cameron

iio: adc: rockchip_saradc: add saradc support for rk3399

The ADC is a 6-channel signal-ended 10-bit Successive
Approximation Register (SAR) A/D Converter.
Signed-off-by: default avatarDavid Wu <david.wu@rock-chips.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 722fc316
Rockchip Successive Approximation Register (SAR) A/D Converter bindings Rockchip Successive Approximation Register (SAR) A/D Converter bindings
Required properties: Required properties:
- compatible: Should be "rockchip,saradc" or "rockchip,rk3066-tsadc" - compatible: should be "rockchip,<name>-saradc" or "rockchip,rk3066-tsadc"
- "rockchip,saradc": for rk3188, rk3288
- "rockchip,rk3066-tsadc": for rk3036
- "rockchip,rk3399-saradc": for rk3399
- reg: physical base address of the controller and length of memory mapped - reg: physical base address of the controller and length of memory mapped
region. region.
- interrupts: The interrupt number to the cpu. The interrupt specifier format - interrupts: The interrupt number to the cpu. The interrupt specifier format
......
...@@ -159,6 +159,22 @@ static const struct rockchip_saradc_data rk3066_tsadc_data = { ...@@ -159,6 +159,22 @@ static const struct rockchip_saradc_data rk3066_tsadc_data = {
.clk_rate = 50000, .clk_rate = 50000,
}; };
static const struct iio_chan_spec rockchip_rk3399_saradc_iio_channels[] = {
ADC_CHANNEL(0, "adc0"),
ADC_CHANNEL(1, "adc1"),
ADC_CHANNEL(2, "adc2"),
ADC_CHANNEL(3, "adc3"),
ADC_CHANNEL(4, "adc4"),
ADC_CHANNEL(5, "adc5"),
};
static const struct rockchip_saradc_data rk3399_saradc_data = {
.num_bits = 10,
.channels = rockchip_rk3399_saradc_iio_channels,
.num_channels = ARRAY_SIZE(rockchip_rk3399_saradc_iio_channels),
.clk_rate = 1000000,
};
static const struct of_device_id rockchip_saradc_match[] = { static const struct of_device_id rockchip_saradc_match[] = {
{ {
.compatible = "rockchip,saradc", .compatible = "rockchip,saradc",
...@@ -166,6 +182,9 @@ static const struct of_device_id rockchip_saradc_match[] = { ...@@ -166,6 +182,9 @@ static const struct of_device_id rockchip_saradc_match[] = {
}, { }, {
.compatible = "rockchip,rk3066-tsadc", .compatible = "rockchip,rk3066-tsadc",
.data = &rk3066_tsadc_data, .data = &rk3066_tsadc_data,
}, {
.compatible = "rockchip,rk3399-saradc",
.data = &rk3399_saradc_data,
}, },
{}, {},
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment