forked from Minki/linux
c8b11de040
AT91 ADC hardware integrate touch screen support. So this patch add touch screen support for at91 adc iio driver. To enable touch screen support in adc, you need to add the dt parameters: 1. which type of touch are used? (4 or 5 wires), sample period time. 2. correct pressure detect threshold value. In the meantime, since touch screen will use a interal period trigger of adc, so it is conflict to other hardware triggers. Driver will disable the hardware trigger support if touch screen is enabled. This driver has been tested in AT91SAM9X5-EK and SAMA5D3x-EK. Signed-off-by: Josh Wu <josh.wu@atmel.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> CC: devicetree@vger.kernel.org Signed-off-by: Jonathan Cameron <jic23@kernel.org>
82 lines
2.8 KiB
Plaintext
82 lines
2.8 KiB
Plaintext
* AT91's Analog to Digital Converter (ADC)
|
|
|
|
Required properties:
|
|
- compatible: Should be "atmel,<chip>-adc"
|
|
<chip> can be "at91sam9260", "at91sam9g45" or "at91sam9x5"
|
|
- reg: Should contain ADC registers location and length
|
|
- interrupts: Should contain the IRQ line for the ADC
|
|
- atmel,adc-channels-used: Bitmask of the channels muxed and enable for this
|
|
device
|
|
- atmel,adc-startup-time: Startup Time of the ADC in microseconds as
|
|
defined in the datasheet
|
|
- atmel,adc-vref: Reference voltage in millivolts for the conversions
|
|
- atmel,adc-res: List of resolution in bits supported by the ADC. List size
|
|
must be two at least.
|
|
- atmel,adc-res-names: Contains one identifier string for each resolution
|
|
in atmel,adc-res property. "lowres" and "highres"
|
|
identifiers are required.
|
|
|
|
Optional properties:
|
|
- atmel,adc-use-external: Boolean to enable of external triggers
|
|
- atmel,adc-use-res: String corresponding to an identifier from
|
|
atmel,adc-res-names property. If not specified, the highest
|
|
resolution will be used.
|
|
- atmel,adc-sleep-mode: Boolean to enable sleep mode when no conversion
|
|
- atmel,adc-sample-hold-time: Sample and Hold Time in microseconds
|
|
- atmel,adc-ts-wires: Number of touch screen wires. Should be 4 or 5. If this
|
|
value is set, then adc driver will enable touch screen
|
|
support.
|
|
NOTE: when adc touch screen enabled, the adc hardware trigger will be
|
|
disabled. Since touch screen will occupied the trigger register.
|
|
- atmel,adc-ts-pressure-threshold: a pressure threshold for touchscreen. It
|
|
make touch detect more precision.
|
|
|
|
Optional trigger Nodes:
|
|
- Required properties:
|
|
* trigger-name: Name of the trigger exposed to the user
|
|
* trigger-value: Value to put in the Trigger register
|
|
to activate this trigger
|
|
- Optional properties:
|
|
* trigger-external: Is the trigger an external trigger?
|
|
|
|
Examples:
|
|
adc0: adc@fffb0000 {
|
|
compatible = "atmel,at91sam9260-adc";
|
|
reg = <0xfffb0000 0x100>;
|
|
interrupts = <20 4>;
|
|
atmel,adc-channel-base = <0x30>;
|
|
atmel,adc-channels-used = <0xff>;
|
|
atmel,adc-drdy-mask = <0x10000>;
|
|
atmel,adc-num-channels = <8>;
|
|
atmel,adc-startup-time = <40>;
|
|
atmel,adc-status-register = <0x1c>;
|
|
atmel,adc-trigger-register = <0x08>;
|
|
atmel,adc-use-external;
|
|
atmel,adc-vref = <3300>;
|
|
atmel,adc-res = <8 10>;
|
|
atmel,adc-res-names = "lowres", "highres";
|
|
atmel,adc-use-res = "lowres";
|
|
|
|
trigger@0 {
|
|
trigger-name = "external-rising";
|
|
trigger-value = <0x1>;
|
|
trigger-external;
|
|
};
|
|
trigger@1 {
|
|
trigger-name = "external-falling";
|
|
trigger-value = <0x2>;
|
|
trigger-external;
|
|
};
|
|
|
|
trigger@2 {
|
|
trigger-name = "external-any";
|
|
trigger-value = <0x3>;
|
|
trigger-external;
|
|
};
|
|
|
|
trigger@3 {
|
|
trigger-name = "continuous";
|
|
trigger-value = <0x6>;
|
|
};
|
|
};
|