drivers/iio/adc/at91-sama5d2_adc.c

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

tanzilli
Contact:
Location: Acme Systems srl - Rome - Italy
Posts: 9
Joined: Fri Jul 06, 2007 11:00 am

drivers/iio/adc/at91-sama5d2_adc.c

Thu Jul 27, 2017 11:52 am

I'm trying the at91-sama5d2_adc.c driver on a Kernel 4.9.28 using the new RoadRunner Som made by us (https://www.acmesystems.it/roadrunner).

On our evaluation kit we link the SAMA5D2 ADVREF and VDDANA pins to a 3.32 volt line generated by a NC1529 voltage regulator. This regulator doesn't have any I2C bus.

The default binding provided by Microchip for the adc is:

adc: adc@fc030000 {
compatible = "atmel,sama5d2-adc";
vddana-supply = <&vdd_3v3_lp_reg>;
vref-supply = <&vdd_3v3_lp_reg>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_adc_default>;
status = "okay";
};

What is the right sintax to provide vddana-supply and vref-supply value directly instead of &vdd_3v3_lp_reg pointer ?

What is the the meaning of this call inside the driver at91-sama5d2_adc.c line 479
http://elixir.free-electrons.com/linux/ ... adc.c#L479

The value of st->vref_uv returned actually is -22 than will fail the driver.
tanzilli
Contact:
Location: Acme Systems srl - Rome - Italy
Posts: 9
Joined: Fri Jul 06, 2007 11:00 am

Re: drivers/iio/adc/at91-sama5d2_adc.c

Thu Jul 27, 2017 1:08 pm

With this definition is works:

adc: adc@fc030000 {
compatible = "atmel,sama5d2-adc";
vddana-supply = <&vdd_3v3_lp_reg>;
vref-supply = <&vdd_3v3_lp_reg>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_adc_default>;
status = "okay";

vdd_3v3_lp_reg: REG_LDO2 {
regulator-name = "VDD_3V3_LP";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
};
};

but I have to force the st->vref_uv to 33000000 inside
drivers/iio/adc/at91-sama5d2_adc.c to avoid the
driver probe fail. How can pass this value with dts with
no touch the driver source ?

st->vref_uv = regulator_get_voltage(st->vref);
printk("st->vref_uv %d\n",st->vref_uv);
st->vref_uv=33000000;
printk("st->vref_uv %d\n",st->vref_uv);
if (st->vref_uv <= 0) {
ret = -EINVAL;
goto vref_disable;
}
blue_z
Location: USA
Posts: 1560
Joined: Thu Apr 19, 2007 10:15 pm

Re: drivers/iio/adc/at91-sama5d2_adc.c

Tue Aug 01, 2017 10:38 pm

tanzilli wrote:On our evaluation kit we link the SAMA5D2 ADVREF and VDDANA pins to a 3.32 volt line generated by a NC1529 voltage regulator. This regulator doesn't have any I2C bus.
Why does a Google search fail to find anything for such a part number?
tanzilli wrote:The default binding provided by Microchip for the adc is:

adc: adc@fc030000 {
compatible = "atmel,sama5d2-adc";
vddana-supply = <&vdd_3v3_lp_reg>;
vref-supply = <&vdd_3v3_lp_reg>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_adc_default>;
status = "okay";
};
No, this looks like more bogus information.
I'm sure there is no Device tree code in mainline or the Linux4SAM github that matches exactly what you posted.
(You need to learn how to use the 'code' tags so that formatting is preserved.)

What kind of power supply control is used on this SoM?
Why are you using the names of ACT8945A regulators?
What regulators do have you defined in the DT for your board?

Regards

Return to “Linux”

Who is online

Users browsing this forum: No registered users and 2 guests