mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-06-08 00:07:34 +09:00

The ROHM BD79104 is a 12-bit, 8-channel ADC with two power supply pins, connected to SPI. It's worth noting the IC requires SPI MODE 3, (CPHA = 1, CPOL = 1). I used an evaluation board "BD79104FV-EVK-001" from ROHM. With this board I had problems to have things working correctly with higher SPI clock frequencies. I didn't do thorough testing for maximum frequency though. First attempt was 40M, then 20M and finally 4M. With 20M it seemed as if the read values were shifted by 1 bit. With 4M it worked fine. The component data-sheet is not exact what comes to the maximum SPI frequency. It says SPI frequency is 20M - "unless othervice specified". Additionally, it says that maximum sampling rate is 1Mhz, and since reading a sample requires writing the channel (16 bits) and reading data (16 bits) - we get some upper limit from this. >From the "frequency is 20M, unless othervice specified" I picked the maximum frequency 20M - and did assumption that my problems with 20M weren't related to the BD79104 - but to the evaluation board "BD79104FV-EVK-001". Add bindings for the ROHM BD79104 ADC. Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Link: https://patch.msgid.link/2a4c65ee35cb79c6b29dbc59cfd9bc7d615a08ac.1744022065.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
69 lines
1.5 KiB
YAML
69 lines
1.5 KiB
YAML
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
|
|
%YAML 1.2
|
|
---
|
|
$id: http://devicetree.org/schemas/iio/adc/rohm,bd79104.yaml#
|
|
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
|
|
|
title: ROHM Semiconductor BD79104 ADC
|
|
|
|
maintainers:
|
|
- Matti Vaittinen <mazziesaccount@gmail.com>
|
|
|
|
description: |
|
|
12 bit SPI ADC with 8 channels.
|
|
|
|
properties:
|
|
compatible:
|
|
const: rohm,bd79104
|
|
|
|
reg:
|
|
maxItems: 1
|
|
|
|
vdd-supply: true
|
|
iovdd-supply: true
|
|
|
|
# The component data-sheet says the frequency is 20M. I, however, found
|
|
# that the ROHM evaluation board BD79104FV-EVK-001 had problems with 20M.
|
|
# I have successfully used it with 4M. My _assumption_ is that this is not
|
|
# the limitation of the component itself, but a limitation of the EVK.
|
|
spi-max-frequency:
|
|
maximum: 20000000
|
|
|
|
"#io-channel-cells":
|
|
const: 1
|
|
|
|
spi-cpha: true
|
|
spi-cpol: true
|
|
|
|
required:
|
|
- compatible
|
|
- reg
|
|
- vdd-supply
|
|
- iovdd-supply
|
|
- spi-cpha
|
|
- spi-cpol
|
|
|
|
allOf:
|
|
- $ref: /schemas/spi/spi-peripheral-props.yaml#
|
|
|
|
unevaluatedProperties: false
|
|
|
|
examples:
|
|
- |
|
|
#include <dt-bindings/interrupt-controller/irq.h>
|
|
spi {
|
|
#address-cells = <1>;
|
|
#size-cells = <0>;
|
|
|
|
adc@0 {
|
|
compatible = "rohm,bd79104";
|
|
reg = <0>;
|
|
vdd-supply = <&vdd_supply>;
|
|
iovdd-supply = <&iovdd_supply>;
|
|
spi-max-frequency = <4000000>;
|
|
spi-cpha;
|
|
spi-cpol;
|
|
#io-channel-cells = <1>;
|
|
};
|
|
};
|
|
...
|